How do I change all occurrences of <*>
in every line of a text file (a total of 5 <*>
in every line) using preg_replace
(substituting it with, say, |
)?
My code is:
preg_replace("/<*\>/", "|", $text);
How do I change all occurrences of <*>
in every line of a text file (a total of 5 <*>
in every line) using preg_replace
(substituting it with, say, |
)?
My code is:
preg_replace("/<*\>/", "|", $text);
You shoud escape the *
preg_replace("/<\*>/", "|", $text);