Answer the question
In order to leave comments, you need to log in
How to pull data from xml file?
Hello. Need to stick out a few lines from the XML file.
To solve this problem, I found such a script.
But it shows only one line of the solution
, and I need several options, or rather everything.
I realized that the number in the PHP file is responsible for the output result. How can I put a range or output everything in a file?
If there are other possibilities of output, then please go to the studio)).
Answer the question
In order to leave comments, you need to log in
There is also this thing.
php.net/manual/en/book.xmlreader.php
Something like this
$reader = new XMLReader();
$reader->open($filexml);
while ($reader->read()) {
switch ($reader->nodeType) {
case (XMLREADER::ELEMENT):
if ($reader->name == "offer" && $reader->nodeType == XMLReader::ELEMENT) {
$doc = new DOMDocument('1.0', 'UTF-8');
$xml = simplexml_import_dom($doc->importNode($reader->expand(), true));
print $xml->picture;
}
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question