function mySqlParse($string)
{
// Load special characters
$special = '-<>.+*$^!()\[\]{}';
// Remove beginning and ending spaces from string.
$string = trim($string);
// Backslash Special Characters
$string = preg_replace('/(\\\\)/', '\\\\\\\\', $string);
$string = preg_replace('/(['.$special.'])/', '\\\\\\\\\1', $string);
// Fix Double Spaces
$string = preg_replace('/\s+/', '[[:space:]]+', $string);
// Insert Word Boundaries
$string = '(^|[[:<:]]|[[:space:]])'.$string.'([[:space:]]|[[:>:]]|$)';
return $string;
}