我試圖做一個「搜索更新頁面」用PHP與此代碼:錯誤。如果用file_get_contents()函數
<?php
$update = file_get_contents('https://raw.githubusercontent.com/esteves25566/gestordebiblioteca/master/updater');
if ($update == "build001"){
}else{
echo "<p style= \"color:red\">Existe um novo update! A nova build é a $update</p>";
}
?>
但當現場輸出build001,進行if語句去閱讀它作爲假,印刷「Existe um novo update!新星建造ébuild001」 我已經試過每一個! 感謝您的幫助!
您是否嘗試使用var_dump($ update)來查看您必須匹配的內容? – wmk