首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > PHP >

php 取值-

2012-06-01 
php 取值---在线等echo $images输出后是{image_intro:images\/f201205281934101426092871.jpg,float_

php 取值---在线等
echo $images
输出后是
{"image_intro":"images\/f201205281934101426092871.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}
怎么取出里面的值呢,如image_inrto


[解决办法]
json_decode后,再取.
[解决办法]
先把json格式转换成数组
[解决办法]
不知道有种格式叫json么?

PHP code
$str='{"image_intro":"images\/f201205281934101426092871.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}';$arr=json_decode($str,true);echo $arr['image_intro']; 

热点排行