接口數據轉json格式html
function tojson($result, $callback = null){ header('Content-Type:text/html; charset=utf-8'); $json_result = urldecode(json_encode($result)); if (empty($callback)) { echo $json_result; } else { echo $callback . "($json_result)"; } die(); }