XpertWorlock Posted December 10, 2008 Share Posted December 10, 2008 If I have the following in arrays. $array(Jeff,1,6,new); $array(Stan,3,5,expert); How would I go about finding "Stan" and than echo 3 and 5? I'm thinking something like array_search or in_array would work, but I'm getting confused ??? This is just an example. Link to comment https://forums.phpfreaks.com/topic/136292-searching-arrays/ Share on other sites More sharing options...
gevans Posted December 10, 2008 Share Posted December 10, 2008 If the layout of the array is never going to change then you can use this if($array[0] == 'whatever sting you want'){ echo $array[1].' '.$array[2]; } Link to comment https://forums.phpfreaks.com/topic/136292-searching-arrays/#findComment-711023 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.