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.          |
`------------------------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to