Home > Backend Development > PHP Tutorial > php怎么将二维数组存入进数据库之中

php怎么将二维数组存入进数据库之中

WBOY
Release: 2016-06-13 12:19:49
Original
2232 people have browsed it

php如何将二维数组存入进数据库之中


请问如何将一二维数组存入进数据库中,我百度了说是用json_encode()或者序列化,但是不知后面该如何操作!!!求大牛知道
------解决思路----------------------
json_encode后就是字符串了。
所以不需要什么特别处理,直接入库就可以。
只不过出库后需要json_decode。


你的问题是,出库后没有对json_encode的字段进行json_decode处理。
例如
$result = array('a'=>'jsonencode后的字符串');

print_r(json_decode($result['a']));

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