我的事情是當我回應我的PHP代碼它沒有回顯代碼回聲的數字作爲回報我正在嘗試向我的網站添加一個PHP代碼,所以每週網站上的文本將從存儲的文件更新,如quotes.txt 。有什麼不對我的PHP有什麼建議嗎?這裏是發生了什麼的截圖https://gyazo.com/fba5fc414228b1ab2a79bb877642477a回聲php代碼錯誤?
我的代碼:
<div class="wrapper">
<div class="teachings">
<h1 id="teach">Teaching's</h1>
<hr>
<?php
$text = file_get_contents("quotes.txt");
$text = trim($text); //This removes blank lines so that your
//explode doesn't get any empty values at the start or the end.
$array = explode(PHP_EOL, $text);
$lineNumber = date('s');
echo "<p>$lineNumber</p>";
?>
<h1>Weekly Teachings :</h1>
<br>
</div>
</div>
'$ LINENUMBER =日期( 'S');'然後你回聲'回聲 「
$ LINENUMBER
」;'_what你以爲happen_ – RiggsFolly@RiggsFolly沒有必要在這裏喊... – arkascha
看那'file'函數,http://php.net/manual/en/function.file.php。不需要'file_get_contents'或'explode'。 – chris85