Search Webmaster Help and Solution

[RESOLVED] preg_replace without replacing qualifiers

How would I use preg_replace to replace everything *between* two qualifiers without replacing the qualifiers themselves? In the following example, Im wanting to replace everything between the "x" and the "p" but what happens is that the "x" and the "p" *also* get replaced:

preg_replace(/(x).*?(p)/,......,example)

will output: e......le
instead of: ex......ple

Thank you How would I use preg_replace to replace everything *between* two qualifiers without replacing the qualifiers themselves? In the following example, Im wanting to replace everything between the "x" and the "p" but what happens is that the "x" and the "p" *also* get replaced:

preg_replace(/(x).*?(p)/,......,example)

will output: e......le
instead of: ex......ple

Thank you

View Complete Thread with Replies

Related Items

Query failed: connection to localhost:3354 failed (errno=111, msg=Connection refused).