JSONのHeaderを送って、連想配列データをJSONエンコードして出力
function print_json($data) {
header("Content-Type: application/json; charset=utf-8");
echo json_encode($data);
}
Linuxサーバの設定やプログラムのことなどを中心にブログを書いています。
function print_json($data) {
header("Content-Type: application/json; charset=utf-8");
echo json_encode($data);
}
0 コメント:
コメントを投稿