atrsimilar_prefix

Versions
6.1
atrsimilar_prefix(&$tokens)

Remove identical prefix for performance improvements.

▾ 1 function calls atrsimilar_prefix()

atrsimilar_diff in atr/modules/atrsimilar/includes/atrsimilar.review.inc
Compute the differences between two strings.

Code

atr/modules/atrsimilar/includes/atrsimilar.review.inc, line 150

<?php
function atrsimilar_prefix(&$tokens) {
  $prefix = '';
  while ($tokens[0] && $tokens[1] && reset($tokens[0]) === reset($tokens[1])) {
    $prefix .= array_shift($tokens[0]);
    array_shift($tokens[1]);
  }

  return $prefix;
}
?>