I have an array, and I want to find all of the indexes of a certain object in the array. When I use array_search
, it only returns the first index in which the object can be found.
echo array_search(3, array(3, 3, 4));
This returns 0, but I want to know that both indexes 0 and 1 have the integer 3 as their object. Is there a way of doing this without using a for
loop?