Re: Heredocs, print_r() and newline "\n" and fnmatch() -curious failures ...

From: Date: Fri, 24 Sep 2010 10:49:08 +0000
Subject: Re: Heredocs, print_r() and newline "\n" and fnmatch() -curious failures ...
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-308326@lists.php.net to get a copy of this message
Peter Lind wrote:
On 23 September 2010 21:47, YAD(YetAnotherDavid) <animaz@mail.com> wrote:
This code is 95% cut and paste from the PHP manual examples - the Types/Strings/Heredocs section and the Filesystem/fnmatch pages. There are actually two questions here - I have combined the code into one ...
Question 1 : how to get the newline functioning ....? even print_r() output is not 'newlined' as it should be. Also note the \n is missing between the " " in the output text of the second test!
Are you outputting to browser or to command line? Browsers have a habit of ignoring whitespaces, reducing them to one whitespace character regardless of their type or how many. Regards Peter
Thanks Peter, - output is to browser, I develop in Notepad++ and Firefox, and confirm in IE8. But this stuff used to work - I have been working with PHP for about two years (not pro) and am used to formatting my output for legibility - especially echoing or var_dumping variables when still testing the code. So the failure is recent and I just can't figure what changed. David

« previous php.general (#308326) next »