我想知道數組中字符串的最大長度是否有限制。我已經已經檢查了我的記憶保留PHP(這是128MB,因此definitelly夠我的目的),並敢肯定,我deteteced實際的問題:字符串數組的限制?
我原來的數組是:
$tabellenA = array
(
"userA" => array
(
"`id`" => "INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY",
"`name`" => "VARCHAR(20) NOT NULL",
"`sirname`" => "VARCHAR(20) NOT NULL",
"`userName`" => "VARCHAR(50) NOT NULL",
"`email`" => "VARCHAR(50) NOT NULL", ,
"`password`" => "VARCHAR(20) NOT NULL",
"`country`" => "VARCHAR(150) NOT NULL",
"`plz`" => "VARCHAR(50) NOT NULL",
"`road`" => "VARCHAR(50) NOT NULL",
"`city`" => "VARCHAR(50) NOT NULL",
"`state`" => "VARCHAR(50) NOT NULL",
"`house_number`" => "VARCHAR(50) NOT NULL",
"`country`" => "VARCHAR(50) NOT NULL",
"`timestamp`" => "DATETIME NOT NULL"
)
);
始終在第19行的C:\ xampp \ htdocs \ Envifood \ req \ Constants.php中調用錯誤消息:「Parse error:syntax error,unexpected',',expected')',直到我在第18行後面剪切數組,代碼看起來像:
$tabellenA = array
(
"userA" => array
(
"`id`" => "INT(10) NOT NULL AUTO_INCREMENT PRIMARY KEY",
"`name`" => "VARCHAR(20) NOT NULL",
"`sirname`" => "VARCHAR(20) NOT NULL",
"`userName`" => "VARCHAR(50) NOT NULL"/*,
"`email`" => "VARCHAR(50) NOT NULL", ,
"`password`" => "VARCHAR(20) NOT NULL",
"`country`" => "VARCHAR(150) NOT NULL",
"`plz`" => "VARCHAR(50) NOT NULL",
"`road`" => "VARCHAR(50) NOT NULL",
"`city`" => "VARCHAR(50) NOT NULL",
"`state`" => "VARCHAR(50) NOT NULL",
"`house_number`" => "VARCHAR(50) NOT NULL",
"`country`" => "VARCHAR(50) NOT NULL",
"`timestamp`" => "DATETIME NOT NULL"*/
)
);
因此,我預計必須有一些k IND的數組中的字符串的最大限制,但我沒有發現任何,但數組(用於讀取大數據文件/ XML到數組)可以得到巨大的...另外我的其他陣列有三倍以上的條目,並且工作!此外,我用這些密鑰製作了一個文本數組,但內容不同,內容較短,可以工作。
您是否看到我的錯誤,還是隻是說數組不能用於較大的字符串?
非常感謝! – nikma