Take alook at the second example at
http://uk.php.net/manual/en/function.preg-replace.php
The 1st parameter is what the function will look for in the defined string, the 2nd parameter is what will be replaced if there are matches in the string, and the 3rd parameter is the string you define.
I,e
PHP Code:
<?php
// my string that i am making
$string = "assassingod is the best at everything";
// what its looking for and if theres a match itll be replaced
$patterns[0] = "/best/";
$patterns[1] = "/at everything/";
// what is going to be inplace of what has been removed
$replacements[0] = "worst";
$replacements[1] = ".";
echo preg_replace($patterns, $replacements, $string);
?>
The output of that will be
Quote:
assassingod is the worst .
|
(Of course that's a false statement

)