Forum Home
|
Marketplace
|
Articles
|
Blogs
|
Interviews
|
Tools
REGISTER
|
SEARCH
|
MEMBERS
|
F.A.Q.
Register Here
Forum Rules
Webmaster-Talk.com
>
Coding Talk
>
PHP Forum
>
fun with regex
Link Back
Thread Tools
fun with regex
07-06-2004, 02:23 PM
#
1
(
permalink
)
fun with regex
drobinson
Junior Talker
Posts: 1
Talkupation:
Hi,
I need to change all the <td> and </td> tags to <th> and </th> tags respectively with the first set of <tr></tr> in a html string.
There will be multiple tables within the string too.
Any advice would be appreciated.
thanks.
When You
Register
, These Ads Go Away!
07-08-2004, 07:27 AM
#
2
(
permalink
)
try the preg_* family of functions
ibbo
Super Spam Talker
Posts: 880
Location: Leeds UK
Talkupation:
for instance
$string = preg_replace("/<th>/" , "<td>", $string);
if you have php5 you can use the str_replace() with the same syntax as above.
ibbo
« Reply to
fun with regex
Previous Thread
|
Next Thread
Webmaster-Talk.com
>
Coding Talk
>
PHP Forum
>
fun with regex
Thread Tools
Show Printable Version
Email this Page
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
vB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
Off
Pingbacks
are
Off
Refbacks
are
Off
Webmaster Resources Marketplace:
Software Development Company
|
Webhosting.UK.com
Web Templates
|
Text Link Brokers
|
Stock Photos
Feeds:
RSS
JS
XML
Feeds for this forum:
RSS
JS
XML
Mark Forums Read
-
View Forum Leaders
-
Contact Us
-
Webmaster Forum
-
Advertise
-
Archive
-
Privacy Statement
-
Top
Page generated in
0.13807
seconds with
12
queries