首頁 >後端開發 >php教程 > 请教joomla中文章里的参数是怎样获取的?

请教joomla中文章里的参数是怎样获取的?

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB原創
2016-06-13 12:59:22828瀏覽

请问joomla中文章里的参数是怎样获取的???
images字段中的数据是:
{"image_intro":"images\/image1.jpg","float_intro":"","image_intro_alt":"","image_intro_caption":"","image_fulltext":"","float_fulltext":"","image_fulltext_alt":"","image_fulltext_caption":""}

<br />
$db = & JFactory::getDBO();<br />
$query="SELECT * FROM #__content ORDER BY publish_up DESC LIMIT 0,7";<br />
$db->setQuery($query);<br />
$rows = $db->loadObjectList();<br />
foreach($rows as $row){<br />
    echo $row->images . '<br>';   //这样只能显示整个字段的内容<br />
}<br />


我想只输出images字段中image_intro里的内容(也就是images/image1.jpg),应该怎么写???
谢谢!!!
------解决方案--------------------
$json = json_decode($row->images);
echo $json->image_intro;

陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn