php给数组key:value中的key加引号

public function Ext_json_decode($str, $mode=false){
if(preg_match('/\w:/', $str)){
$str = preg_replace('/(\w+):/is', '"$1":', $str);
}
return json_decode($str, $mode);
}

 

 

$httpstr = http($url, $data,'POST', array("Content-type: application/x-www-form-urlencoded; charset=utf-8"));

echo http_build_query($data);

 打印$httpstr组成的字符串

posted @ 2017-01-16 17:14  煎饼侠不会飞  阅读(882)  评论(0编辑  收藏  举报