Re: remove header tags - include file

From: Date: Fri, 19 Jul 2002 00:13:58 +0000
Subject: Re: remove header tags - include file
Groups: php.general 
Request: Send a blank email to php-general+get-108389@lists.php.net to get a copy of this message
>This is my problem: >I want include the file html.html inside of my file index.php, but before >include it I want to remove <html>..</head> tags from my html.html file. <?php $html = file('html.html'); $found = 0; while (list(,$line) = each($html)){ if ($found){ echo $line; } else{ if ($rest = stristr($line, '</head>')){ $rest = substr($rest, 7); echo $rest; $found = 1; } } } ?> Although, honestly, this is just WRONG design. Put your <HTML>...</HEAD> into *another* file, and either include it or don't, depending on which way you want it. -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#108389) next »