新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
php將xml轉(zhuǎn)換為數(shù)組
- 函數(shù):
/* @desc:xml轉(zhuǎn)數(shù)組 @param data xml字符串 @return arr 解析出的數(shù)組 */ function xmltoarray($data){ $obj = simplexml_load_string($data, 'SimpleXMLElement', LIBXML_NOCDATA); $json = json_encode($obj); $arr = json_decode($json, true); return $arr; }
- 測試:
a. 代碼:Forty What? Joe Jane I know that's the answer -- but what's the question?b. 輸出:
創(chuàng)新互聯(lián)成立十余年來,這條路我們正越走越好,積累了技術(shù)與客戶資源,形成了良好的口碑。為客戶提供網(wǎng)站制作、網(wǎng)站設(shè)計、網(wǎng)站策劃、網(wǎng)頁設(shè)計、域名注冊、網(wǎng)絡(luò)營銷、VI設(shè)計、網(wǎng)站改版、漏洞修補等服務(wù)。網(wǎng)站是否美觀、功能強大、用戶體驗好、性價比高、打開快等等,這些對于網(wǎng)站建設(shè)都非常重要,創(chuàng)新互聯(lián)通過對建站技術(shù)性的掌握、對創(chuàng)意設(shè)計的研究為客戶提供一站式互聯(lián)網(wǎng)解決方案,攜手廣大客戶,共同發(fā)展進步。
array(4) { ["title"]=> string(11) "Forty What?" ["from"]=> string(3) "Joe" ["to"]=> string(4) "Jane" ["body"]=> string(57) " I know that's the answer -- but what's the question? " }
本文名稱:php將xml轉(zhuǎn)換為數(shù)組
分享URL:http://fisionsoft.com.cn/article/pepihi.html