Thursday, 15 March 2012

php - preg_replace -



php - preg_replace <*> -

how alter occurrences of <*> in every line of text file (a total of 5 <*> in every line) using preg_replace (substituting with, say, |)?

my code is:

preg_replace("/<*\>/", "|", $text);

you shoud escape *

preg_replace("/<\*>/", "|", $text);

php preg-replace

No comments:

Post a Comment