@ZnupiJul 19.2008 — #If you want to strip html tags (well, any <tags>)you can use the [url=http://php.net/strip-tags]strip_tags()[/URL] function. If it's not only tags, let us know and we'll come up with some pattern most probably ?
@ZnupiJul 19.2008 — #[code=php] preg_replace("%<.*?>%", '', $first_post); [/code] I'd test it but I'm at my girlfriend's house. Let us know if it works ?
i tried putting them the same way but didn't work[/QUOTE] What does this have to do with the requirement stated in the original post? If all you are doing is changing the <...> to [...], just change my last suggestion to: [code=php] preg_replace('/[[^]]*]/', '', $text); [/code]
worked TY?[/QUOTE] That won't work if there happens to be a ">" within the square brackets. [code=php] <?php $text = "This is [not]a test. It is[<really>] only a test."; echo preg_replace('/[[^]]*]/', '', $text); [/code] Outputs:
[indent]This is a test. It is only a test.[/indent]