Reputation: 71
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, |)?
<*>
preg_replace
|
My code is:
preg_replace("/<*\>/", "|", $text);
Upvotes: 2
Views: 415
Reputation: 14865
You shoud escape the *
*
preg_replace("/<\*>/", "|", $text);
Upvotes: 5