Here are some collections of really cool yet tricky, wacky, nasty thing in programming that you should always watch out for.
1. Why '\r' or '\n\r' Does'nt inserts a NEWLINE Char in PHP
'\n\r' generally don't help you to get a NEWLINE (what you want or what you intend) to do because because PHP honors
'\n\r' only if it is enclosed in double quotes.
Hence using double quotes like these "\r" and "\n\r" is the correct way to use in PHP to insert NEWLINE.
2. Should I use
"\n\r" are ways to insert NEWLINE Character in PHP. They are Operating System Specific
Mac or *nix like Operating System uses
"\r" and Windows uses
"\n\r" to represent a newline character. since PHP 5.0.2 PHP_EOL is The correct 'End Of Line' symbol for PHP. PHP will decide itself depending on PHP_OS to use
"\r" on *nix and
"\n\r" on Windows.
3. How to clear Terminal content on Mac ?
Simplest way to clear the screen is using
clear command. You can use shortcut
ctrl + l. This ll do as mentioned but you ll be able to still see the content when you scroll up or scroll down. To clear that scroll buffer or scroll content. You can use
CMD + k. Now you will not be able to see the content even on scrolling.
This will be very useful when you debugging with logs, You can completely clear away your previous logged errors.