DanA

msg:1258881 | 5:51 pm on Dec 19, 2005 (gmt 0) |
You can try this : $test="<table>anytext</table>"; $patterns=array("/<table>/","/<\/table>/"); $replacements=array("[table]","[/table]"); $test=preg_replace($patterns,$replacements,$test);
|
ergophobe

msg:1258882 | 6:35 am on Dec 20, 2005 (gmt 0) |
Because </table> just is what it is, I would just use a str_replace(). For table, presumably you want something that can catch <table class="someclass"> In that case, a pattern like $pattern = '/<(table([^><]*>/U'; should work.
|
orion_rus

msg:1258883 | 10:45 am on Dec 21, 2005 (gmt 0) |
Thanks for answers! It works great!
|
killroy

msg:1258884 | 11:17 am on Dec 21, 2005 (gmt 0) |
if u want a single pattern and replace for both jsut use this pattern: \<(/?table(?: [^>]*))\> and replace with <$1> SN
|
|