assuming I have the following array:
Code: Select all
$arr = Array("bob" => "aaa", "alice" => "bbb");Code: Select all
$var = "alice";I.e. "bob" is the first key, so its order is 0, "alice" is 1,...
thanks in advance
Moderator: General Moderators
Code: Select all
$arr = Array("bob" => "aaa", "alice" => "bbb");Code: Select all
$var = "alice";Code: Select all
array_search($var, keys($arr));