php remove string from string regex code example Example: php preg_replace function preg_replace($pattern, $replacement, $string);