PHP 读取JSON数据

今天在写一个小模块,找了下怎么转成JSON格式的数据。

具体如下面代码:

<?php
$db=new mysqli("localhost",'root','mojige123','w3a_monitor');
$rows=$db->query("select * from web_jiankong");
$row=$rows->fetch_assoc();
echo json_encode($row);
?>