<?php $places = array((object)array('PlaceId' => 837, 'Name' => 'United Arab Emirates', 'Type' => 'Country'), (object)array('PlaceId' => 838, 'Name' => 'Afghanistan', 'Type' => 'Country'), (object)array('PlaceId' => 839, 'Name' => 'Antigua and Barbuda', 'Type' => 'Country') ); if (($k = array_search(837, array_column($places, 'PlaceId'))) !== false) { print_r($places[$k]); } else { echo "Not found!"; }
You have javascript disabled. You will not be able to edit any code.