Lets say I have this string:
This Is a test - called "test"
I run 2x eregi_replace() on a string that does the following
$string = eregi_replace('([a-zA-Z0-9. \"])','\\1\\',$string);
which adds to any special chars with a backslash at the start&end of it.
and
$string = eregi_replace('([ +])','\\1 ',$string);
which adds a backslash to the start of any backspace found.
so my result of above is:
This\ Is\ a\ test\ -[COLOR=red][/COLOR] called\ \"test\"
1) How can I get both eregi_replace()-arguments into one?
2) How can I fix the issue with the backslashes? As I would like to have a result like this:
This\ Is\ a\ test\ -\ called\ \"test\"
so there's no double \
Thanks in advance!