當前位置:博客首頁>>PHP >> 閱讀正文

php出現(xiàn)operator not supported for strings in..錯誤的解決方法

作者: 鄭曉 分類: PHP 發(fā)布于: 2012-04-20 12:44 瀏覽:15,664 沒有評論


operator not supported for strings
PHP代碼出現(xiàn)這樣的錯誤怎么辦:
Fatal error: [] operator not supported for strings in

在使用類似下面的方法進行數(shù)據(jù)賦值時可能出現(xiàn)這樣的錯誤:

$test_arr[] = $t;
而且是在當前頁面對$test_arr進行第二次賦值的時候,也就是在同一頁面內對同一變量第二次賦值,但值的類型不一致會導致這個錯誤,可以在第二次賦值前重新進行一次聲明變量類型……簡單的來說,就是同一頁面內,同一變量前后賦值的類型不一致所導致的。

? ? ? ?

本文采用知識共享署名-非商業(yè)性使用 3.0 中國大陸許可協(xié)議進行許可,轉載時請注明出處及相應鏈接。

本文永久鏈接: http://www.yjfs.org.cn/php-operator-not-supported-for-strings-in-error-solution.html

發(fā)表評論

change vcode