首頁 >後端開發 >php教程 > php 取值-

php 取值-

WBOY
WBOY原創
2016-06-13 13:29:191062瀏覽

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']; <div class="clear">
                 
              
              
        
            </div>
陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn