I have an array created in PHP as follows:
$arr = array(123,144,144,123);
How do I get the first and last indexes of occurrence of each value.
Something like,
123 -> first occurrence - 0th index | last occurrence - 3rd index
144 -> first occurrence - 1st index | last occurrence - 2nd index
See Question&Answers more detail:os