Print

Print


Found this on the web, which I can work with, but
does anyone have a complete non-filing article
(English only) routine ready to go?

Should be able to add "a " and "an " , and the function below should work
right?

kevin
=====================

a quick function to point uksort() at, for sorting by key, but ignoring
"the" from any keys that start with it:

<?php
function comp($a,$b)
{
   //remove "the" (case-insensitive), and any non-word
   // characters from any string(s) that start with "the"
   $a = preg_replace('|^the\b\W*|i','',$a);
   $b = preg_replace('|^the\b\W*|i','',$b);

   if ($a == $b) {
       return 0;
   }
   return ($a > $b) ? 1 : -1;
}
?>