\n 没有换行?

\n 没有换行?

<?php
$colors = array('red', 'blue', 'green', 'yellow');

foreach ($colors as $color) {
    echo "Do you like $color?\n";
}

?>

这个是代码换行阿.你查看源码可以看到换行的.
要想在页面看到换行应该用<br>

[复制到剪切板]
CODE:
<?php
$colors 
= array('red''blue''green''yellow');

foreach (
$colors as $color) {
    echo 
"Do you like $color?<br>";
}

?> ;


毕业了。。。

呵呵
谢谢,
初学者

一语惊醒梦中人

不知为不知,知之为知之