Miller, Terion wrote:
> I am trying to get rid of empty whitespace lines, I can't us chop() because
> as I read it it will remove all whitespaces....right?
> Right now my db is outputting with extra lines, I have stripped tags I know
> it isn't that causing it to look like this
> Blahlajdlkfjlksdjflkdjsf
>                <--------------how do I get rid of all this extra space?
> alkdfjlsdakjflsakdjflksjdf

If the white space is included in data coming from the db you could run
a simple little regex on the variable to removed any repetitive white
space.  But it might not be the best way to do it.

        $clean = preg_replace('|\s+|', ' ', $input);
        $clean = preg_replace('|\s{2,}|', ' ', $input);

If the white space is being generated in your HTML output, but is not in
your data store, then you need to cleanup your PHP code and that might help.

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to