Home > Backend Development > PHP Tutorial > 请教php如何讲数据库返回的查询数据转化为json数据格式

请教php如何讲数据库返回的查询数据转化为json数据格式

WBOY
Release: 2016-06-13 12:44:51
Original
1270 people have browsed it

请问php怎么讲数据库返回的查询数据转化为json数据格式
   在zend 框架里面的
    $res=$db->query("select  name from job_type where tid=$type")->fetchAll();
我把数组打出来是这个东西:


array(2) { [0]=> array(1) { ["name"]=> string(6) "技工" } [1]=> array(1) { ["name"]=> string(6) "普工" } }




   

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template