[問題] 奇怪的php問題=.=
※ [本文轉錄自 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 james@example.com
很怪,因為我有加入"\n" 去空行啊 ? 怎麼會有這麼奇怪的結果
請各位幫幫忙啊 ^^ ~~
PS:系統是linux
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.122.79.88
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.122.79.88
推
03/06 18:47, , 1F
03/06 18:47, 1F
推
03/06 19:49, , 2F
03/06 19:49, 2F
→
03/06 21:32, , 3F
03/06 21:32, 3F
推
03/07 09:49, , 4F
03/07 09:49, 4F
→
03/07 12:18, , 5F
03/07 12:18, 5F
PHP 近期熱門文章
PTT數位生活區 即時熱門文章