Regex str_replace Regex str_replace php php

Regex str_replace


Check out preg_replace here, this is what you are lookin for.

// From the documentation.preg_replace($regularExpression, $replacement, $subject); 


What you're looking for is preg_replace:

$pg = preg_replace('{regex goes here}', '{replacement goes here}', $pg);