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

看板PHP作者 (哆啦A孟)時間18年前 (2007/03/06 18:42), 編輯推噓3(302)
留言5則, 5人參與, 最新討論串1/1
※ [本文轉錄自 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
在 html 是用 <br/> 作斷行
03/06 18:47, 1F

03/06 19:49, , 2F
html \n 沒用 要用<BR>
03/06 19:49, 2F

03/06 21:32, , 3F
您受過 HTML 的專業訓練嗎?
03/06 21:32, 3F

03/07 09:49, , 4F
你要打 "換行"它就換行 來亂的 !!XD!!
03/07 09:49, 4F

03/07 12:18, , 5F
THANKS ALL
03/07 12:18, 5F
文章代碼(AID): #15xKMA0m (PHP)
文章代碼(AID): #15xKMA0m (PHP)