看板 Electronics 關於我們 聯絡資訊
<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 adddream:轉錄至看板 PHP 03/06 18:42