Re: get code out of file

From: Date: Sat, 29 Jul 2000 06:06:56 +0000
Subject: Re: get code out of file
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-8924@lists.php.net to get a copy of this message
Try this: $FileContents = file("yourfilename.whatever"); # creates an array containing your file for ($txtline=0; $txtline < count($FileContents); $txtline++) { echo("$FileContents[$txtline]<BR>"); } (not tested) There are other ways to open the file and read it, this is just one example. Read the file open and read sections of the manual for more. Hope this helps. Jeff Tyler Longren wrote: > > That's what I'm doing, but how? > > thanks! > > On Fri, 28 Jul 2000, Jeff Wolkove wrote: > > Date: Fri, 28 Jul 2000 22:55:00 -0700 > > To: tyler.longren@midiowa.net > > From: Jeff Wolkove <php@biz-link.com> > > Subject: Re: [PHP] get code out of file > > > > Instead of including it in the page, I would suggest that you > > use another page to read the file at run time and display it. > > That way the code won't get interpreted or executed. Then > > you can reuse that same code to display any other file you > > want. > > > > Jeff > > > > Tyler Longren wrote: > > > > > > I've got some php code stored in a text file. How can I print that > > code to > > > a webpage without it being highlighted OR being executed? > > > > > > Thanks! > > > Tyler Longren > > > > > > -- > > > 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 > >

« previous php.general (#8924) next »