The code below generates the text for the e-mail that is sent when a user requests a new password:
<?php echo __('Your password has been reset, your new login information can be found below:') ?>
Email: <?php echo $sfGuardUser->getEmailAddress().PHP_EOL; ?>
Contraseña: <?php echo $password; ?>
As you can see there are two empty lines between the two first lines of code.
When the email arrives, the empty lines are in the same number as in the .php file. In this case two. I just expected the end of the sentence “Your password..” would be immediately followed by “Email”…
Can someone explain to me why this happens?
Anything outside of
<?php ?>tags will be sent straight to the browser/outputted to the command-line, depending on how you’re calling PHP. If you want to avoid emitting them, you need to make them code by including them in the php tag: