[PHP] preg_replace using multi-dimensional arrays?

arxanas

New member
Will it cause a parse error or something by having an array like this:
$array_example = array(array(":)", ":-)"), array(":(", ":-("));
$array_replacements = array(":]", array(":["));
$result = preg_replace($array_example, $array_replacement);
which should turn both :) and :-) into :],and so on.
Or do I have to use some regex to do this?
 
Back
Top