The quick brown cat
The quick brown fox jumps over the lazy dog.";
echo str_replace("fox", "cat", $haystack);
$now2 = microtime();
echo preg_replace("/fox/","cat", $haystack);
$now3 = microtime();
echo "str_replace: " . ($now2-$now1)/1000 . "s.
";
echo "preg_replace: " . ($now3-$now1)/1000 . "s.
";
?>