Re: - Hard return in readfile

From: Date: Thu, 17 May 2001 00:42:40 +0000
Subject: Re: - Hard return in readfile
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-53133@lists.php.net to get a copy of this message
on 5/16/01 8:38 PM, Ray Iftikhar at kryptonik_php@hotmail.com wrote: > I have many text files stored on my server. I call them use using the > "readfile" function. While that works great, it seems to over-write the hard > returns. This has hurt the format and readability of my information. > > ie. > text file: > This is > a > > test > > output: > This is a test > > is there someway to get "readfile" to recognize returns in the file? > Thanks in Advance.. > Ray Sounds like you are displaying the text as HTML. You can either surround the data with <pre> tags, or use the nl2br() function to convert each new line to a <br> tag. -- /chris/

« previous php.general (#53133) next »