[問題] 奇怪的php問題=.=

看板Electronics作者 (哆啦A孟)時間19年前 (2007/03/06 14:24), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
<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
文章代碼(AID): #15xGaf3V (Electronics)
文章代碼(AID): #15xGaf3V (Electronics)