Jump to content

ereg_replace remove text that begins with ___ and ends with ___


dallypost

Recommended Posts

I have a block of text stored in a string that includes [keywords]some random text[/keywords]

 

I want to replace [keywords], [/keywords] and everything in between with "" (nothing)

 

I have been trying many versions of this:

 

$string=ereg_replace("regex expression", "", $string);

 

Nothing seems to work. I know that this is probably pretty basic but regular expressions just about kill me.

 

Thanks for your help

 

Lance

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.