Re: Simple question I hope

From: Date: Tue, 16 Dec 2003 20:12:04 +0000
Subject: Re: Simple question I hope
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-172833@lists.php.net to get a copy of this message
That worked. Thanks Robert. "Robert Cummings" <robert@interjinn.com> wrote in message news:1071605134.29331.1.camel@blobule.suds... > On Tue, 2003-12-16 at 15:02, Christopher J. Crane wrote: > > I am using Pdf-Php to create pdf docs. I have a long text line that wraps > > automatically when outputted in the pdf. That is what it is suppose to do, > > however, it also outputs the new lines of the text in the source of the php > > file. That is not what I want. So I do a string replace for the "\n" and > > replace it will "" or nothing and instead I get " " or two spaces. > > > > Example: > > $Scope = " > > <i>$Report</i> is a report summarizing all the locations within the > > Northeast Region. It contains all known > > business lines including LDS, BDS, and BS. Below each location will be > > listed with summary > > data relating to the location such as the full mailing address, phone > > number, network information > > and information about the phone system."; > > $Scope = str_replace("\n", "", $Scope); > > > > Here I have a newline in the first line after the word known. I don't want > > it to put the new line there. So I added the str_replace function, but I get > > a double space instead of a single space. > > try: > > $Scope = trim( ereg_replace( '[[:space:]]+', ' ', $Scope ) ); > > Cheers, > Rob. > -- > .------------------------------------------------------------. > | InterJinn Application Framework - http://www.interjinn.com | > :------------------------------------------------------------: > | An application and templating framework for PHP. Boasting | > | a powerful, scalable system for accessing system services | > | such as forms, properties, sessions, and caches. InterJinn | > | also provides an extremely flexible architecture for | > | creating re-usable components quickly and easily. | > `------------------------------------------------------------'

« previous php.general (#172833) next »