Mega Code Archive
Categories
/
Php
/
Strings
Replacing a Pattern with a Found String
preg_replace
rntsoft
"; $pattern = '/
(.*?)<\/a>/i'; $replacement = '\2:
\1
'; $string = preg_replace($pattern, $replacement, $string); print($string); ?>