I'm trying to understand why some spaces in my output are being stripped and others are not. Here is my code:
<?php include '/PATH/TO/header.php'; ?> <html> <head> <title>Testing</title> </head> <body> this is a line from index.php </body> </html>
<div style="text-align:center"><font size=4> "Welcome" </font> <br/> <?php echo 'Today is '; echo date("l"); echo ', '; echo date("F d"); echo ' '; echo date("Y"); ?> </div> <?php echo '<br/>'; echo 'CWD = '; echo getcwd(); echo '<br/>'; ?>
The output looks (something) like this:
Today is Wednesday, October 21 2009
this is a line from index.php
So, why do the spaces in the output line, "Today is .....", show up while the spaces before and after the '=' in the output line, "CWD=..." get stripped? Also, (perhaps this should be a clue?) if I relocate the "echo '<br/>';" line from above "echo 'CWD = ';" to below "echo date("Y");" the line break doesn't get echoed.