我對PHP很陌生。我創建了我已經列入不過當我需要回顯網址這是我的settings
陣列它只是給我下面的錯誤的數組:PHP內含回聲內容
Parse error: syntax error, unexpected 'templateurl' (T_STRING) in C:\xampp\htdocs\index.php on line 15
感謝您的幫助和時間提前。
我對PHP很陌生。我創建了我已經列入不過當我需要回顯網址這是我的settings
陣列它只是給我下面的錯誤的數組:PHP內含回聲內容
Parse error: syntax error, unexpected 'templateurl' (T_STRING) in C:\xampp\htdocs\index.php on line 15
感謝您的幫助和時間提前。
試試這個:
<?php include('hi.php'); echo $settings['templateurl'];?>
您需要首先包含的文件,然後你可以從中檢索數據。
謝謝。如果我想從數組中獲得兩件事情,我該怎麼辦? 'include('echo $ settings ['templateurl'] echo $ template ['templateheader']');'其中templateheader是文件的路徑。 –
不要犯同樣的錯誤。看看我給你閱讀的代碼。先包含,然後你可以使用裏面的其他變量。根據你的例子: <?php echo $ settings ['currenttemplateurl']; echo $ template ['templateheader']; ?> 如果頭是路徑<?php include($ template ['templateheader']); ?> –
我決定在數組中沒有文件名。但是,當我使用這種方法。我似乎得到了約5000個PHP錯誤。我認爲它正在尋找與index.php相同的目錄中的文件。我很困惑。 –
你能告訴我們代碼嗎? – Ad5001
這是我的代碼。 '<?php include('echo'$ settings ['templateurl']「hi.php'); ?>' –