2013-03-16 45 views
0
<?php 
$txt="Hello, my name is Max Koenig."; 
$intro="I was Born and raised in Calgary, Alberta with my Mother, Father and Sister."; 

echo $txt . " ". $intro; 
echo strlen ("Hello, my name is Max Koenig."); 



$t=date("H"); 

if ($t>"10") 
    echo "Good Morning"; 

elseif ($t>"16") 
    echo "Good afternoon"; 

elseif ($t>"19") 
    echo "Goodnight" 

?> 

所有這一切麻煩的是在整個頁面一個單行跨越,我不知道如何使他們在不同的行我在使用PHP把代碼放在多行

+0

聲音就像您的文件沒有被網絡服務器解析 – 2013-03-16 21:57:17

+0

要開始一個新行,請使用html換行符:回聲'早上好'
' – 2013-03-16 21:58:54

回答

2

請在每個PHP語句之後使用HTML Break行標記。像

$txt="Hello, my name is Max Koenig. <br />"; $intro="I was Born and raised in Calgary, Alberta with my Mother, Father and Sister. <br />"; 
+0

非常感謝 – Max 2013-03-16 22:56:33

相關問題