--- a/lib/common.inc.php +++ b/lib/common.inc.php @@ -67,10 +67,32 @@ echo ""; } } - +function cleanseName($input) { + + return trim(join(" ",array_filter(explode(" ",strtolower($input)), function($v, $k) { + $cleanseNamesCorp = Array( + "ltd", + "limited", + "australia", + "australian", + "australasia", + "(aus)", + "(aust)", + "(australia)", + "the", + "pty", + "contractors", + "p/l", + "inc.", + "inc", + "incorporated" + ); + return !in_array($v,$cleanseNamesCorp) ; +}, ARRAY_FILTER_USE_BOTH))); +} function ucsmart($str) { $shortWords = Array("The", "Pty", "Ltd", "Inc", "Red", "Oil", "A", "An", "And", "At", "For", "In" - , "Of", "On", "Or", "The", "To", "With"); + , "Of", "On", "Or", "The", "To", "With", "Use", "No", "Yes"); $strArray = explode(" ", preg_replace_callback("/(?<=(?