View Full Version : eregi_replace pattern
02-07-2006, 11:34 AM
I'm trying to change a body tag from a string of html from whatever it is to <body>.
$dataHtml = eregi_replace("'<body[^>]*?>',","<body>",$dataHtml);
Any help would be appreciated.
02-07-2006, 01:51 PM
I'm a bit confused about what you're trying to do here. isnt <body> a body tag?
What exactly are you trying to accomplish?
02-07-2006, 02:40 PM
$dataHtml = preg_replace('/<body[^>]*>/', '<body>', $dataHtml);
only change I'd suggest is to make it case insensitive:
$dataHtml = preg_replace('/<body[^>]*>/i', '<body>', $dataHtml);
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.