i have json file i want to print in php [title] replace the MGM lion with your pet or whoever i have json file: i tried to use foreach //foreach($obj as $result){ //echo($result->gigs); //} stdClass Object ( [gigs] => Array ( [0] => stdClass Object ( [title] => replace the MGM lion with your pet or whoever [cached_slug] => replace-the-mgm-lion-with- your-pet-or-whoever-you-want [status] => approved [title_full] => replace the MGM lion with your pet or whoever [duration] => 4 [price] => $5 [price_i] => 5 [rating] => 10 [rating_count] => 10 [is_featured] => [gig_id] => 246395 [gig_url] => /rogh/replace-the-mgm-lion-with-your-pet-or-whoever-you-want?context=advanced_search&context_type=rating&pos=1&funnel=27e195fe-bd42-4f6c-a15a-b01aa28a085b [image_data] => stdClass Object ( [photo_file_name] => puppy_mgm_sized.jpg [title] => replace the MGM lion with your pet or whoever [cloud_img_base] =>
if you have json file. first read the json file $json_data = file_get_contents($json_file_name); $json_object = json_decode($json_data); $json_object will have std class objec which can be accessed by $json_object->title; If you want array instead of object then use $json_object = json_decode($json_data, TRUE);