OsakaWebbie
Programmer
When using ereg_replace, is it possible to call a function to operate on the "\\1" substring somehow? If I just say:
it passes a literal backslash and a literal "1", rather than the string that \\1 should represent. If I leave off the quotes, I get two warnings about a backslash, and a literal "1" is passed to the function each time. Encasing it in { and } doesn't help. Is there a technique that will work, or do I have to make a loop to dismantle my string, call my function, and put the string back together again? There is no mention in the PHP docs of using function calls with ereg_replace, so no clues there.
Code:
echo ereg_replace("start(middle)end","start".myfunction("\\1")."end",$thestring)