note 115880 deleted from tutorial.firstpage by peehaa

From: Date: Mon, 09 Mar 2015 09:42:08 +0000
Subject: note 115880 deleted from tutorial.firstpage by peehaa
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-201895@lists.php.net to get a copy of this message
Note Submitter: ivan at ivandigital dot com ---- Note on Line Feeds These are 2 alternative ways to add a line feed after a php block. --- 1. Echo a "\n" at the end of the block. <?php echo "Hello World"; echo "\n"; ?> Alternatively you can also concatenate "\n" to the last echo/print in the block. <?php echo "Hello World" . "\n"; ?> Note: the string "\n" must be inside double quotes; using single quotes will output the literal string. --- 2. Add two line feeds after the closing ?> tag. By explicitly adding two line feeds after the closing ?> tag, the first one will be removed by php, and the second one will appear in the output. --- One advantage of both approaches is that you don't need to add a space after the closing ?> tag (to force a space and a line feed to be output), instead, only the line feed is output.

« previous php.notes (#201895) next »