Re: strip from <html to closing body tag

From: Date: Mon, 07 Jan 2002 13:04:38 +0000
Subject: Re: strip from <html to closing body tag
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-79684@lists.php.net to get a copy of this message
Hi, the code u sent is displaying the html as it is, but There is more than one way to do that. Atmost we can atleast do this. $pos = strpos($html,"<body"); $start = substr($html,0,$pos - 1); $html = substr($html,$pos); $start = preg_replace("/<html>/","",$start); print "$start $html" ; On Mon, 7 Jan 2002, Jimmy wrote: > Hi WB, > > > > Hi i need to strip out the <html> up to the <body> tag. > > preg_replace( "/<html(.*)body(.*)>" , " " , $body ); > > try this: > preg_replace( "/<html>[^<body>]*<body[^>]*>/" , " " , > $body ); > > > -- > Jimmy > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > Your mind is like parachute. It works best when it is open. > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net > S.Murali Krishna smk_bk@yahoo.com ===================================== We grow slow trying to be great - E. Stanley Jones -------------------------------------

« previous php.general (#79684) next »