thinkphp3.2处理json数据

1 数组转json

/*
* test json
* */
public function test(){
$arr = array (
'name' => 'hello' ,
'pic' => 'img' ,
'size' => 666
);

$this ->ajaxReturn( $arr , 'json' );
}
上面就可以直接返回json数据


你可能感兴趣的:(php)