PHP Regular Expression Replacements – String Function

<?
    $a = "Foo moo boo tool foo";
    $b = preg_replace("/[A-Za-z]oo\b/", "Got word: $0\n", $a);
    print $b;
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.