English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I'm trying to do ereg_replace(">(. )<", "><", $string);, however it is not working as intended. I want to remove an unknown number of spaces between >< (xml tags).

Thanks

2007-02-27 08:28:51 · 3 answers · asked by Brady 3 in Computers & Internet Programming & Design

3 answers

(">[\s]+<","><")

in english

">" , at least 1 white space , "<" becomes "><"

2007-02-27 09:42:52 · answer #1 · answered by jake cigar™ is retired 7 · 1 0

Try ">\s+<" as your pattern. Replace with "><".

2007-02-27 17:21:51 · answer #2 · answered by javier 2 · 0 0

your (.) is acting as a greedy replacer. Try (.*?) instead

2007-02-27 16:30:57 · answer #3 · answered by Tapan 4 · 0 0

fedest.com, questions and answers