PHP preg_replace three times with three different patterns
Posted on 10th Sep 2023 18:48:51 in yellow-pages
PHP preg_replace three times with three different patterns
As you are replacing all with the same, you could do either pass an array
$content = preg_replace(array($pattern1,$pattern2, $pattern3), '', $content);
or create one expression:
$content = preg_replace('/regexp1|regexp2|regexp3/', '', $content);
As you are replacing all with the same, you could do either pass an array
$content = preg_replace(array($pattern1,$pattern2, $pattern3), '', $content);
or create one expression:
$content = preg_replace('/regexp1|regexp2|regexp3/', '', $content);
.


