note 6069 modified in str_replace by ronabop
| From: | ronabop@php.net | Date: | Fri, 11 Aug 2000 18:32:27 +0000 |
| Subject: | note 6069 modified in str_replace by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-1396@lists.php.net to get a copy of this message | ||
A way to remove multiple items without using
str_replace("","",(str_replace"","", $var)):
<?php
$patterns = array("/B/", "/D/" );
$replacement = array("-", "=");
print preg_replace($patterns, $replacement, "ABCDE");
?>
Hope that helps!
http://www.php.net/manual/function.str-replace.php