| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|PHP regular expression|
I have to ask you about preg_replace
i need to change <table> -> [table] and </table> -> [/table]
can i make it both in a one expression?
Thanks in advance!
You can try this :
Because </table> just is what it is, I would just use a str_replace().
For table, presumably you want something that can catch
In that case, a pattern like
$pattern = '/<(table([^><]*>/U';
Thanks for answers!
It works great!
if u want a single pattern and replace for both jsut use this pattern:
and replace with <$1>
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved