read "include" part of a file, I have a script problem??
| From: | Laurent Zajfe | Date: | Mon, 05 Nov 2001 18:44:52 +0000 |
| Subject: | read "include" part of a file, I have a script problem?? | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-69653@lists.php.net to get a copy of this message | ||
Hi,
I have my file: begin.inc, from which I want to include a part in my php page. I have included this
part between the tags:
"<!--BeginPHP-->" &
"<!--EndPHP-->", but I can't have my loop working.
Here is What I have written:
$FileName = "begin.inc";
$Content = file($FileName);
$BeginIt = "<!--beginPHP-->";
$EndIt = "<!--endPHP-->";
do {
if ($Key == $BeginIt) {
echo $Val;
} elseif ($Key == $EndIt) {
Break;
}
} while(list($Key,$Val) = each($Content) );
What is wrong with my script?