#37404 [Bgs]: Escape Sequences not Working

From: Date: Thu, 11 May 2006 14:40:21 +0000
Subject: #37404 [Bgs]: Escape Sequences not Working
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-96970@lists.php.net to get a copy of this message
ID: 37404 Updated by: tony2001@php.net Reported By: werty37 at gmail dot com Status: Bogus Bug Type: Output Control Operating System: Ubuntu Dapper Drake Beta PHP Version: 5.1.5CVS New Comment: Yes, this is correct for _shell_. But I bet the book presumes you already know what HTML is and how to add a newline there. Previous Comments: ------------------------------------------------------------------------ [2006-05-11 14:22:40] werty37 at gmail dot com #This is what i found in an ebook on php ############################################# $person = array('Edison', 'Wankel', 'Crapper'); foreach ($person as $name) { echo "Hello, $name\n"; } ############################################## #This is what it is suppossed to print #Hello, Edison #Hello, Wankel #Hello, Crapper #But this is what it prints #Hello, EdisonHello, WankelHello Crapper ------------------------------------------------------------------------ [2006-05-11 09:34:35] tony2001@php.net Newlines in HTML look like "<br/>". ------------------------------------------------------------------------ [2006-05-11 09:20:01] werty37 at gmail dot com Description: ------------ I tried to use the escape syntax "\n" but php is not printing a newline. I also tried "\r" and "\t" but still no use. The php version im using is: PHP 5.1.2-1ubuntu2 Reproduce code: --------------- <?php $friends_list = array('Sujith','Kalesh','Sijin','Ridhul'); foreach($friends_list as $friends) { echo "Hello, $friends\n"; } ?> Expected result: ---------------- Hello, Sujith Hello, Kalesh Hello, Sijin Hello, Ridhul Actual result: -------------- Hello, Sujith Hello, Kalesh Hello, Sijin Hello, Ridhul ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=37404&edit=1

« previous php.bugs (#96970) next »