php apiで返す場合 header('Content-Type: application/json'); をつけること php

php apiで返す場合
header( Content-Type: application/json );
をつけること

例)
値設定
$r_array[ searchword ] = あああ ;
$r_array[ result ] = OKOKOK!!!あああ ;

返すよ
header( Content-Type: application/json );
$r_json = json_encode($r_array);
echo $r_json ;