I've been working my way through W3Schools' PHP course and I've become flummoxed by something in one of the lessons -
http://www.w3schools.com/php/php_form_complete.asp
The form is filled using globals which are assigned after the user hits 'submit', the same globals are then echoed in the PHP block at the end of the script.
Here's my modification which specifies default values for the globals to avoid the need to fill in the form and hit submit -
phpfiddle link to my modification
What's confused me is that the comment box is -
I've no<br> comment
but when it's echoed by PHP the spaces are stripped and the output is -
I've no
comment
Echoing the var_dump of $comment gives -
string(23) "I've no
comment"
Both the comment box and the echo statement use the same source, $comment, but the format of the string is different. Why is that? Can someone please explain this discrepancy to me.