我有此腳本,填補了數組,但據我所知,PHP是不符合5.6陣列轉換爲5.6
<?php
$LANG = array();
$LANG[create_new_ticket] = "Create New Ticket";
$LANG[ticket_created] = "Your ticket has been created. An email has been sent to you containing the ticket information. If you would like to view your ticket and/or attach files you can do so: <a href=\\\"{\$HD_URL_TICKET_VIEW}?id=\$ticket&email={\$_POST[email]}\\\">\$ticket</a>";
$LANG[fill_in_form] = "To create a new support ticket, please fill out the form below.";
$LANG[required_field] = "* Denotes a required field";
/?>
但這種方式引發的許多
Notice: Use of undefined constant create_new_ticket - assumed
'create_new_ticket' in D:\xampp\htdocs\tickets\lang\language.php on line 4
Notice: Use of undefined constant ticket_created - assumed
'ticket_created' in D:\xampp\htdocs\tickets\lang\language.php on line 5
Notice: Use of undefined constant fill_in_form - assumed
'fill_in_form' in D:\xampp\htdocs\tickets\lang\language.php on line 6
Notice: Use of undefined constant required_field - assumed
'required_field' in D:\xampp\htdocs\tickets\lang\language.php on line 7
這是正確的語法?
$ LANG [ 「create_new_ticket」]或$ LANG [」 create_new_ticket']用單引號或雙引號括住密鑰。對於數字鍵的括號不是必需的,但對於字符串鍵,則需要加上引號。 – ameenulla0007
這與PHP版本之間的「遵從性」沒有任何關係......這只是與您在服務器上配置的錯誤報告級別有關......這始終發佈通知,在此之前已禁用顯示通知 –
Ouch。謝謝 – Robert