一聚教程网:一个值得你收藏的教程网站

最新下载

热门教程

php domDocument分析xml文档

时间:2022-07-02 10:10:36 编辑:袖梨 来源:一聚教程网

 
 */
 
 $epg_info = $_GET['epg_info'];
    $epg_info = urldecode($epg_info);
    print_r($epg_info);
    //echo $epg_info;
    //exit();

    $doc = new DOMDocument();
    $xml = file_get_contents($epg_info);     //这里是我新改过的
    $doc->loadXML($xml);
  $server_ip = $doc->getElementsByTagName("server_ip")->item(0)->nodeValue;
    $group_name = $doc->getElementsByTagName("group_name")->item(0)->nodeValue;
    $group_path = $doc->getElementsByTagName("group_path")->item(0)->nodeValue;
    $oss_user_id = $doc->getElementsByTagName("oss_user_id")->item(0)->nodeValue;
    $page_url = $doc->getElementsByTagName("page_url")->item(0)->nodeValue;
  
    echo 'server_ip:'. $server_ip.'
';
    echo 'group_name:'. $group_name.'
';
    echo 'group_path:'. $group_path.'
';
    echo 'oss_user_id:'. $oss_user_id.'
';
    echo 'page_url:'. $page_url.'
';

热门栏目