为什么不把课后题和学习中想到的东西记录下来呢?
第38页练习:
$name = $_POST[''];// 如何把两个变量整合呢? $_POST['firstname'] . $_POST['lastname']; 用点粘合?
$how_many = $_POST['howmany'];
$what_they_did = $POST['whattheydid'];
$other = $_POST['other'];
echo 'Number of aliens:' . $how_many . '<br />';//为什么br后要空一格?
echo 'The aliens did this:' . $what_they_did . '<br />';
echo 'Other comments:' . $other . '<br />';
第43页练习:
$msg = "$name was abducted $when_it_happend and was gone for $how_long \n" .
"Number of aliens: $how_many \n".
"Alien description: $alien_description \n" .
"What they did $what_they_did \n" .
"Fang spotted: $fang_spotted \n" .
"Oher comments: $other";
为什么之前发给浏览器可以用<br />而现在不能用了呢?我的理解是:之前发给浏览器的是HTML文本,浏览器可以识别<br />是换行符,而现在发给email的是文本所以需要用\n让PHP编译器编译出换行符。(不知是否正确,后面学习继续修改)
·单引号串只支持\' 和 \\转义字符,所有其他转义字符都只能用于双引号串。
今天到这,明天继续
PHP确实很好用,不过感觉没有C自由......
愉快的去看C了~