I did a search, but couldn't find anything, so if it is there, please forgive me...
I am having a logic problem. Scenario:
I have an array, with multiple elements. I know that many elements will be identical, and many will not. I will not necessarily know what the contents of my array are (in other words, they change constantly). I do know that those elements that are alike will be bunched together. Example:
$p[0] = "Jason";
$p[1] = "Jason";
$p[2] = "Peter";
$p[3] = "Peter";
$p[4] = "Peter";
$p[5] = "Ralph";
$p[6] = "Ralph";
I need a snippet of code that can tell me, when that element changes. In other words, I need something that will tell me:
Jason = 0
Peter = 2
Ralph = 5
Any ideas?