Hi,
I´m searching an array for a particular value. Now I want to know the array´s index, where the value is in. That´s my script yet:
<?php
$array[] = "bla";
$array[] = "test";
$array[] = "yesnoyes";
$searchfor = "test";
if(in_array($searchfor, $array)){
echo "exists, ".key($array);
}else{
echo "don´t exist";
}
?>
... But it always shows index 0. How can I make it work?