@ 2015-09-03T12:00:51Z <?php
var_dump(get_type([]));die;
$source = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<datapacket packet_type="send_data" version="3.15.3.15" level="1" reg_number="705" ogrn="1027808757899" mac_address="50:46:5D:4E:F7:06" comp_name="k415-1" interval_end_date="2015-03-26 14:12:53">
<teachers>
<teacher teacher_id="705000000208" fio="Яловенко Любовь Николаевна" uid=""/>
<teacher teacher_id="705000000211" fio="Шкарубо Людмила Ивановна" uid=""/>
<teacher teacher_id="705000000214" fio="Шибаева Оксана Викторовна" uid=""/>
<teacher_delete teacher_id="705000000214" fio="Шибаева Оксана Викторовна" uid=""/>
<teacher_delete teacher_id="705000000214" fio="Шибаева Оксана Викторовна" uid=""/>
</teachers>
<last_marks>
<last_mark last_mark_id="705000111240"/>
<last_mark last_mark_id="705000111240"/>
<last_mark_deleted last_mark_id="705000111240"/>
<last_mark_deleted last_mark_id="705000144740"/>
<last_mark_deleted last_mark_id="705000200530"/>
</last_marks>
</datapacket>
XML;
$reader = new XMLReader();
if ($reader->xml($source)) {
var_dump($reader->readString());die;
} else {
throw new Exeption('Ошибка при разборе XML');
}
// LIBXML_ERR_ERROR
// LIBXML_ERR_FATAL
// LIBXML_ERR_NONE
// LIBXML_ERR_WARNING
var_dump($xml);
die;
$xml = simplexml_load_string($string);
foreach($xml->children()->children() as $nodeName => $child) {
var_dump($child);
$child = $child->attributes();
var_dump($child);
$child = $child['@attributes'];
var_dump($child);
die;
}
die;
$xml = new SimpleXMLElement($string);
$result = $xml->xpath('teachers');
var_dump($result);
die;
while(list( , $node) = each($result)) {
echo '/teachers: ',$node,"\n";
}
/* Относительные пути также работают... */
$result = $xml->xpath('b/c');
while(list( , $node) = each($result)) {
echo 'b/c: ',$node,"\n";
}
?>
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 , 7.2.0 - 7.2.33 , 7.3.0 - 7.3.33 , 7.4.0 - 7.4.33 , 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.19 , 8.3.0 - 8.3.7 Fatal error: Uncaught Error: Call to undefined function get_type() in /in/eUFSF:3
Stack trace:
#0 {main}
thrown in /in/eUFSF on line 3
Process exited with code 255 . Output for 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 Fatal error: Call to undefined function get_type() in /in/eUFSF on line 3
Process exited with code 255 . Output for 4.4.2 - 4.4.9 , 5.1.0 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 Parse error: syntax error, unexpected '[', expecting ')' in /in/eUFSF on line 3
Process exited with code 255 . Output for 4.3.0 - 4.3.1 , 4.3.5 - 4.3.11 , 4.4.0 - 4.4.1 , 5.0.0 - 5.0.5 Parse error: parse error, unexpected '[', expecting ')' in /in/eUFSF on line 3
Process exited with code 255 . Output for 4.3.2 - 4.3.4 Parse error: parse error, expecting `')'' in /in/eUFSF on line 3
Process exited with code 255 . preferences:dark mode live preview
304.6 ms | 401 KiB | 461 Q