| Welcome to WebmasterWorld Guest from 184.108.40.206 |
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
|Accredited PayPal World Seller|
|PHP regular expression|
| 4:50 pm on Dec 19, 2005 (gmt 0)|
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!
| 5:51 pm on Dec 19, 2005 (gmt 0)|
You can try this :
| 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
In that case, a pattern like
$pattern = '/<(table([^><]*>/U';
| 10:45 am on Dec 21, 2005 (gmt 0)|
Thanks for answers!
It works great!
| 11:17 am on Dec 21, 2005 (gmt 0)|
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 ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved