Full PHP course: ➤ https://davehollingworth.net/phpy
It's best practice to omit the PHP closing tag for files that just contain PHP.
This is because it's too easy to insert whitespace after the closing tag. If you're using a function like header, session_start or setcookie, which send HTTP headers, no whitespace can be sent before the headers. If it is, you get the "headers already sent" error.
Resources shown in the video:
http://php.net/manual/en/language.bas...
https://www.php-fig.org/psr/psr-2/
http://php.net/manual/en/outcontrol.c...
Watch video How to fix the "headers already sent" error: omit the closing tag in pure PHP scripts online without registration, duration hours minute second in high quality. This video was added by user Dave Hollingworth 20 April 2018, don't forget to share it with your friends and acquaintances, it has been viewed on our site 38,910 once and liked it 252 people.