Regular Expression Replacements : preg_replace « String « PHP
- PHP
- String
- preg_replace
Regular Expression Replacements
<?
$a = "Foo moo boo tool foo";
$b = preg_replace("/[A-Za-z]oo\b/", "Got word: $0\n", $a);
print $b;
?>
Related examples in the same category