View Full Version : eregi_replace pattern
02-07-2006, 12:34 PM
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, 02: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, 03: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 © 2016 vBulletin Solutions, Inc. All rights reserved.