Skip to content

Instantly share code, notes, and snippets.

@jacobch
Created February 21, 2011 04:19
Show Gist options
  • Save jacobch/836655 to your computer and use it in GitHub Desktop.
Save jacobch/836655 to your computer and use it in GitHub Desktop.
function ps ( $A ) {
$used = array();
$index = 0;
$count = count($A);
for($i = 0; $i < $count; $i++) {
if (!isset($used[$A[$i]])) {
$index = $i;
$used[$A[$i]] = true;
}
}
return $index;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment