Jump to content

preg_replace


doddsey_65

Recommended Posts

im trying to do a complex(i think) prg replace but i keep getting the error:

 

Failed evaluating code: $lang->showing-1,1

 

the code i am trying to replace is:

 

<asf: lang[showing-<asf: var[num_report_alerts]>,<asf: var[num_report_alerts]>]>

 

and the preg_replace is:

 

$content = preg_replace('|\<asf: lang\[(.*?)-(.*?)\]\>|e', '$lang->replace_vars($lang->//1, array(\\2))', $content);

 

its supposed to take everything inside <asf: lang[]> and echo \\1 which would be "showing" and then add \\2 into an array which would be "array(1,1)".

 

So the output would be showing 1 of 1.

 

Anyone know where im going wrong?

 

Link to comment
https://forums.phpfreaks.com/topic/236700-preg_replace/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.