我已经创建了一个动态JSON文件。如何使用PHP显示JSON数据
我的代码是:
$res = mysql_query("select * from tbl_product where category='saree'");
while($rowpro=mysql_fetch_array($respro)) {
$records []= $rowpro;
$json_string=file_put_contents("product_file.json",json_encode($records));
}
我怎样才能从JSON文件中的数据?使用while循环或类似的东西?