preg_replace rules for php 7.3 code example
Example 1: preg_replace
<?php
$string = 'April 15, 2003';
$pattern = '/(\w+) (\d+), (\d+)/i';
$replacement = '${1}1,$3';
echo preg_replace($pattern, $replacement, $string);
Example 2: php preg_replace function
preg_replace($pattern, $replacement, $string);
Example 3: preg_replace rules for php 7.3
function wpFlashInsertSwf($content) {
return preg_replace("'\[swf:(.*?)\]'ie", "stripslashes(wpFlashParseMacro('\\1'))", $content);