如何使它向後兼容PHP5.2?它適用於5.3及更高self ::在PHP5.2
錯誤
Fatal error: Cannot call method self::utf8_dec() or method does not exist
代碼
private function utf8_decode($arr){
array_walk_recursive($arr, 'self::utf8_dec'); // <----- error
return $arr;
}
private function utf8_dec(&$value, $key){
$value = utf8_decode($value);
}
PHP 5.2被認爲是EOL,不應該再使用。試着說服你的客戶升級到至少5.3或5.4 –