Re: read "include" part of a file, I have a script problem??

From: Date: Mon, 12 Nov 2001 22:04:25 +0000
Subject: Re: read "include" part of a file, I have a script problem??
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-70273@lists.php.net to get a copy of this message
On November 5, 2001 11:57 am, OntheAve wrote: > 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? It looks like you are missing a newline at the end of the $BeginIt and $EndIt strings. Also, the dev list is generally for discussing issues regarding the development of PHP -- for general PHP questions, please post to the PHP General mailing list. See php.net/support.php for more information. -- Zak Greant PHP Quality Assurance Team http://qa.php.net/ "We must be the change we wish to see." - M. K. Ghandi

« previous php.dev (#70273) next »