|
-
December 22nd, 2007, 02:05 PM
#1
Extra \n where unnecessary...
We have several include_once()s in our code, of which those included PHP files also contain include_once() functions. At the end, a series of 5-6 \n are printed out. What is the cause of this, and how can we fix it?
-
December 23rd, 2007, 11:30 PM
#2
Re: Extra \n where unnecessary...
You end with 5-6 line returns or actual "\n"?
Either way, somehow one of those included files is echoing those characters.
If the post was helpful...Rate it! Remember to use [code] or [php] tags.
-
January 11th, 2008, 08:35 AM
#3
Re: Extra \n where unnecessary...
preg_replace(array('\n+', '\r+'), '',$output); perhaps?
But now that would remove *all* new lines and returns, you probably don't want that, so I guess (\n{5,6}) and (\r{5,6}) should do the trick.
Last edited by ludakot; January 11th, 2008 at 08:37 AM.
-
January 14th, 2008, 10:53 AM
#4
Re: Extra \n where unnecessary...
The cuase may be either \n or \r characters before <? and/or \n or \r after ?> have been saved within the code files.
I also want to add here, that your script will not work perfect when saving cookeis on client's computer, as well as some more header() calls may result in error such as
'header already sent, output stated at line ###'.
regards
Last edited by Ali Imran; January 14th, 2008 at 10:56 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|