severndigital Posted August 11, 2008 Share Posted August 11, 2008 is there a way to determine the position of an item in the array?? for example $arrayTest = array("item1","item2","item3"); if(in_array("item2",$arrayTest){ //some command to tell the script that item2 is location at $arrayTest[1] } is this possible?? or am i approaching this the wrong way? Thanks, -C Link to comment https://forums.phpfreaks.com/topic/119083-solved-in_array-return-array-location/ Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 You can check out array_search(). Link to comment https://forums.phpfreaks.com/topic/119083-solved-in_array-return-array-location/#findComment-613161 Share on other sites More sharing options...
severndigital Posted August 11, 2008 Author Share Posted August 11, 2008 Thanks dark .. i knew it was easy .. i just had a brain fart. too much coding over vacation. Thanks again -C Link to comment https://forums.phpfreaks.com/topic/119083-solved-in_array-return-array-location/#findComment-613162 Share on other sites More sharing options...
DarkWater Posted August 11, 2008 Share Posted August 11, 2008 Np, just please mark this topic as solved. =P Link to comment https://forums.phpfreaks.com/topic/119083-solved-in_array-return-array-location/#findComment-613168 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.