Re: question about INCLUDE behavior

From: Date: Tue, 26 Dec 2000 18:18:00 +0000
Subject: Re: question about INCLUDE behavior
Groups: php.general 
Request: Send a blank email to php-general+get-31862@lists.php.net to get a copy of this message
$print_data === 1 include DOES NOT return the text of the file. The text of the file is _included_ where your include statment is. include() is returning 1, which means it was successful, and then your are printing that out. Chris On Tue, 26 Dec 2000, Romulo Roberto Pereira wrote: > Date: Tue, 26 Dec 2000 12:59:10 -0500 > To: <php-general@lists.php.net> > From: "Romulo Roberto Pereira" <php@diffdev.com> > Subject: [PHP] question about INCLUDE behavior > > Hello! > > I have this include file: > include.inc > --------- (line is not included) > <table> > <tr> > .... > </tr> > </table> > --------- (line is not included) > > In my code I am doing the following: > .... > if ($publication_type == "magazines") { > $print_data = include ('included.inc'); > echo $print_data; > } > .... > > and the results are the following > > --------- (line is not included) > <table> > <tr> > .... > </tr> > </table> > 1 > --------- (line is not included) > > I have this " 1 " there that I don't know where come from... Could > you > please tell e what is that? > > BTW the work around that I found is the following (it is dirty but is > working): > --------- (line is not included) > <table> > <tr> > .... > </tr> > </table> > <!-- > --------- (line is not included) > > and is printing the following now: > > --------- (line is not included) > <table> > <tr> > .... > </tr> > </table> > <!-- > 1 > --------- (line is not included) > > problem solved... > > I know that is veeery ugly, but I don't understand RegEx (by the way, > where > I can find info about this?) and I could not figure out a string > function > that will take out this last character... > > Heeeeelp!!! > > ;-) > > thank you!! > > Rom > > >

« previous php.general (#31862) next »