Parsing XML using PHP

后端 未结 8 2216
日久生厌
日久生厌 2020-12-12 02:16

I\'ve consistently had an issue with parsing XML with PHP and not really found \"the right way\" or at least a standardised way of parsing XML files.

Firstly i\'m tr

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-12 02:50

    You would want something like this:

    'content' => $node->getElementsByTagNameNS('http://search.yahoo.com/mrss/', 'content')->item(0)->getAttribute('url');
    'thumbnail' => $node->getElementsByTagNameNS('http://search.yahoo.com/mrss/', 'thumbnail')->item(0)->getAttribute('url');
    

    I believe that will work, it's been a while since I've done anything like this.

提交回复
热议问题