$string = 'TEXT [ GARBAGE ] TEXT [ GARBAGE ] TEXT'; $string = preg_replace('/\[[^\]]+\]/','',$string); echo $string;
Should do the trick. On Nov 9, 2007 11:50 AM, Olaf Bosch <[EMAIL PROTECTED]> wrote: > > Hi all, > sorry for this OT, can you help me with this? > > I have this string "Text [ Trash ] Text [ Trash ] Text" > > I will have this "Text Text Text" > > What can i do? my stupid try: > > $news_desc = preg_replace ('![.+?]!is','',$news_desc); > > > -- > Viele Grüße, Olaf > > ------------------------------- > [EMAIL PROTECTED] > http://olaf-bosch.de > www.akitafreund.de > ------------------------------- >