作者adddream (哆啦A孟)
看板PHP
标题[问题] 奇怪的php问题=.=
时间Tue Mar 6 18:42:17 2007
※ [本文转录自 Electronics 看板]
作者: adddream (哆啦A孟) 站内: Electronics
标题: [问题] 奇怪的php问题=.=
时间: Tue Mar 6 14:24:40 2007
<html>
<title>PHP hello</title>
<head></head>
<body>
<?php
$price = 3.95;
$tax_rate = 0.08;
$tax_amount = $price * $tax_rate;
$tatal_cost = $price + $tax_amount;
$username = 'james';
$domain = '@example.com';
$email_address = $username .$domain;
print 'the tax is ' .$tax_amount;
print "\n\n";
print 'the total cost is ' .$total_cost;
print "\n\n";
print $email_address;
?>
</body>
</html>
以上,执行结果是 the tax is 0.316 the total cost is 4.266000
[email protected]
很怪,因为我有加入"\n" 去空行啊 ? 怎麽会有这麽奇怪的结果
请各位帮帮忙啊 ^^ ~~
PS:系统是linux
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.122.79.88
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.122.79.88
1F:推 yukang:在 html 是用 <br/> 作断行 03/06 18:47
2F:推 arzbar:html \n 没用 要用<BR> 03/06 19:49
3F:→ ileadu:您受过 HTML 的专业训练吗? 03/06 21:32
4F:推 alexblue:你要打 "换行"它就换行 来乱的 !!XD!! 03/07 09:49
5F:→ adddream:THANKS ALL 03/07 12:18