|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-05-11 09:20 UTC] 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
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 12:00:01 2025 UTC |
#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