I created a array dynamic like:
$tmp = array ( array("name" > "rob"),
array("name" => "bla"));
Now i wand to search for the “index” in the array (with elemnt) Name = “rob”
like : give me the index for the array with the key “rob”, the answer should be 0,
the index for key “bla” sould be 1…
Is it possible to to this without a for or foreach function ?
With a standard PHP function ?
thanks for the answer.
Requires PHP5.3
Or you can use
array_keys()(works in pre-5.3 too)$indexsis an array now, because there can be of course more than one index with the valuearray('name' => $key)within$tmp