Jump to content

[SOLVED] in_array ... return array location??


severndigital

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.