How can I replace surrounding text using a regular expression?
e.g. I want to replace "=1=" with "= 1 = ", "=2=" with "= 2 =", etc.
If you know that there will always be 1+ digits between the equal signs: $x = ereg_replace("=([0-9]+)=","= \1 =",$x);
If there can be letters and numbers between the equal signs: $x = ereg_replace("=([a-zA-Z0-9]+)=","= \1 =",$x);