I am configuring a job board API and have got it to where I can print the full array but I would like to echo only specific parts.
Here is the array and I have stopped after 2 entries to keep it compact.
Array
(
[search_settings] => Array
(
[query] => Information Technology
[location] => chicago
[miles] => 15
[sort] => dd
[window_size] => 50
[publisher_id] => 22222
[search_style] => 2
[configuration_flag] => r
[auth] => 123456
[client_ip] => 111.111.111.111
)
[request_url] => http://api.simplyhired.com/a/jobs-api/xml_v2/q-Information+Technology/l-chicago/mi-15/ws-50/sb-dd
[request_title] => Information Technology Jobs - Chicago, IL
[request_time] => 2014-10-22 16:44:30 EDT
[start_index] => 0
[num_results] => 50
[total_results] => 20724
[total_viewable_results] => 778
[jobs_collection] => Array
(
[0] => Array
(
[job_key] => 7055.x0146017d3fd5
[title] => Senior Information Security Manager
[company_name] => Teambradley
[company_url] =>
[source] => JobServe Ltd
[url] => http://api.simplyhired.com/a/job-details/view/jobkey-7055.x0146017d3fd5/rid-yvujgjnejabmuqwgjvmogcpatdfjkhue/cjp-0/hits-20724?icsrc=xml&rfr=partner
[type] => organic
[is_paid] =>
[is_sponsored] =>
[is_organic] => 1
[location] => Chicago, IL
[city] => Chicago
[state] => IL
[postcode] => 60624
[county] => Cook County
[region] =>
[country] => US
[date_last_seen] => 2014-10-22 13:11:50 EDT
[date_that_posted] => 2014-10-22 13:11:50 EDT
[description] => technical security control design, architecture, security technology implementation, information security solution engineering, etc. If you are interested in this job opportunity, contact TeamBradley today to learn more! WHEN RESPONDING TO...>
)
[1] => Array
(
[job_key] => 43374f83d8ee563c1f5d17128063425db4bc1052
[title] => Instructor II
[company_name] => General Dynamics Information Technology
[company_url] =>
[source] => General Dynamics Information Technology, Inc
[url] => http://api.simplyhired.com/a/job-details/view/jobkey-43374f83d8ee563c1f5d17128063425db4bc1052/rid-yvujgjnejabmuqwgjvmogcpatdfjkhue/cjp-1/hits-20724?icsrc=xml&rfr=partner
[type] => organic
[is_paid] =>
[is_sponsored] =>
[is_organic] => 1
[location] => Chicago, IL
[city] => Chicago
[state] => IL
[postcode] => 60624
[county] => Cook County
[region] =>
[country] => US
[date_last_seen] => 2014-10-22 11:37:11 EDT
[date_that_posted] => 2014-10-22 11:37:11 EDT
[description] => Dynamics Information Technology provides information technology (IT), systems engineering, professional services ... been at a like-type and like-level facility. Additional Information Relocation No Security Clearance Level Background...>
)
I would like to echo the title, url and city from all entries from the job_collection array.
I am able to echo parts from the first part of the array using
echo $myArray[search_settings]['publisher_id'];
I can also echo a single value from the jobs_collection array with the below
echo $jobs22[jobs_collection][0]['city'];
I assume I can use a for or while loop but I can't get anything to work.
foreach ($jobs22[jobs_collection] as $job) {
echo $job['title'] . ' in ' . $job['city'] . " @ " . $job['url'];
}
Adjust to what you need