参见英文答案 >
PHP parse/syntax errors; and how to solve them? 15个
我怎么能摆脱这个错误?
Parse error: syntax error, unexpected T_DOUBLE_ARROW in /var/www/core/restvt.api.php on line 35
PHP代码:
$datax = Array();
foreach ($inis as $key => $data){
if ($data=="mem"){
$str = number_format($ARRAY[(array_search($data.':',$ARRAY)+2)]/1024,0,',','.')." MB [ ".number_format(($ARRAY[(array_search($data.':',$ARRAY)+2)]/$ARRAY[(array_search($data.':',$ARRAY)+1)])*100,0,',','.')." % ]";
array_push($datax, "mem"=>$str); //error here, why?
}else{
array_push($datax,$data=>$ARRAY[(array_search($data.':',$ARRAY)+1)]);
}
}
$jsonr = json_encode($datax);
很多你的帮助……