The parameters for this function are:
- the array to search
- the value to search
Return value is the element key.
function indexof($array,$value) {
foreach($array as $key=>$val)
if($val == $value) return $key;
}
For troubleshooting I use Colt Python .357
function indexof($array,$value) {
foreach($array as $key=>$val)
if($val == $value) return $key;
}
0 comments:
Post a Comment