$ext=strtolower(end(explode(".", $val)));
end();函數(shù)的php文檔的介紹:The array. This array is passed by reference because it is modified by the function. This means you must pass it a real variable and not a function returning an array because only actual variables may be passed by reference.
我看的意思是不能通過函數(shù)返回數(shù)組,為什么這么寫可以呢。
$ext=strtolower(end(explode(".", $val)));這段代碼在index.php的325行。
求解!!謝謝!
2014-08-13
你看到end這個函數(shù)是只能的參數(shù)是取變量的地址,不可以直接把值直接傳進去,所以會報這個警告。當PHP5.3以后嚴格校驗的時候就會報這個問題。只能傳變量,不可以直接寫值。
2014-08-10
有老師能解釋一下具體的原因嗎,為什么必須通過一個變量引用才行呢,Java中這樣寫好像可以,php中所有的函數(shù)是不是都必須通過變量引用才行,還是個別的。
2014-08-10
$arr=explode(".", $val);
$ext=strtolower(end($arr));
這樣改就行了。
2014-08-10
我測試一下,報錯了,Strict Standards: Only variables should be passed by reference in。我自己的代碼和下載的源碼都出現(xiàn)同樣的錯誤。
不知道你們的是否和我的一樣。