I
I
Ioldyz2016-06-19 18:56:35
PHP
Ioldyz, 2016-06-19 18:56:35

PHP parsing Hebrew rss through simplexml or domdocument doesn't return anything, why?

Good afternoon.
I'm trying to get RSS data in the form of an array or object
The link to RSS itself is rss.mivzakim.net/rss/category/10
when I try it through simplexml it gives an error


simplexml_load_string(): Entity: line 207: parser error : Entity 'ndash' not defined

if via DomDocument
$doc = new \DOMDocument();
  $doc->load($xmlstr);
  $root = $doc->documentElement;

then inside $root there is only one .....
Please help me with this task
PS in .htaccess is utf-8

Answer the question

In order to leave comments, you need to log in

3 answer(s)
M
Muhammad, 2016-06-19
@Ioldyz

https://github.com/imangazaliev/didom - with the ability to process invalid documents

D
Dmitry Entelis, 2016-06-19
@DmitriyEntelis

Hebrew has nothing to do with it, a problem in the processing of ndash. There are 2 options for solving the problem:
1) You can stupidly replace –the document with a regular dash —
2) You can use any parser in pure php, for example https://github.com/revnode/xml
I was not too lazy to check that it processes your file perfectly.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question