$array = array("name" => "Eric","age" => 23); echo json_encode($array);
程序将打印出 : {“name”:”Eric”,”age”:23}
再看下面的例子:
$array = array(0 => "Eric", 1 => 23); echo json_encode($array);
程序将打印出 :["Eric",23]
时间: 2024-11-05 11:45:42
$array = array("name" => "Eric","age" => 23); echo json_encode($array);
程序将打印出 : {“name”:”Eric”,”age”:23}
再看下面的例子:
$array = array(0 => "Eric", 1 => 23); echo json_encode($array);
程序将打印出 :["Eric",23]