Answer the question
In order to leave comments, you need to log in
How to parse such xml document?
there is a string (obtained from the document), a string, because some work has already been done with it.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<w:document xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main" xmlns:w10="urn:schemas-microsoft-com:office:word" xmlns:wp="http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing" xmlns:wps="http://schemas.microsoft.com/office/word/2010/wordprocessingShape" xmlns:wpg="http://schemas.microsoft.com/office/word/2010/wordprocessingGroup" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:wp14="http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing" xmlns:w14="http://schemas.microsoft.com/office/word/2010/wordml" mc:Ignorable="w14 wp14">
<w:body>
<w:p>
<w:r>
<w:rPr>
<w:lang w:val="ru-RU"/>
</w:rPr>
<w:t xml:space="preserve">Кому: </w:t>
</w:r>
<w:r>
<w:rPr>
<w:lang w:val="en-US"/>
</w:rPr>
<w:t>Search</w:t>
</w:r>
<w:r>
<w:rPr>
<w:lang w:val="ru-RU"/>
</w:rPr>
<w:br/>
<w:t xml:space="preserve">Куда: </w:t>
</w:r>
<w:r></w:r>
</w:p>
</w:body>
</w:document>
simplexml_load_string(эта строка)
object(SimpleXMLElement)#1 (0) {
}
Answer the question
In order to leave comments, you need to log in
Give direction where to dig
$xml = simplexml_load_string($data);
var_dump(
$xml->children('w', true)->body
->children('w', true)->p
->children('w', true)->r
->children('w', true)->rPr
->children('w', true)->lang
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question