<?php
$xml = new SimpleXMLElement('<vehicle id="8" identyfikator="23">
<name>MAREK</name>
<recorder ppp="fdfd">8</recorder>
<production-date>0</production-date>
<registration-number>SI40996</registration-number>
<fuel>
<type>
</type>
<nominal>0</nominal>
<drive>0</drive>
<work>0</work>
<stay>0</stay>
</fuel>
<attr>
<at name="PHONE_NUMBER" type="5">123456789</at>
<at name="EMAIL" type="5">w@wp.pl</at>
</attr>
</vehicle>');
echo '<pre>';
var_dump($xml);
echo $xml->recorder->attributes();
- Output for 5.5.24 - 5.5.26, 5.6.8 - 5.6.10, 7.4.0 - 7.4.4, 7.4.6 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
- <pre>object(SimpleXMLElement)#1 (7) {
["@attributes"]=>
array(2) {
["id"]=>
string(1) "8"
["identyfikator"]=>
string(2) "23"
}
["name"]=>
string(5) "MAREK"
["recorder"]=>
string(1) "8"
["production-date"]=>
string(1) "0"
["registration-number"]=>
string(7) "SI40996"
["fuel"]=>
object(SimpleXMLElement)#2 (5) {
["type"]=>
object(SimpleXMLElement)#4 (0) {
}
["nominal"]=>
string(1) "0"
["drive"]=>
string(1) "0"
["work"]=>
string(1) "0"
["stay"]=>
string(1) "0"
}
["attr"]=>
object(SimpleXMLElement)#3 (1) {
["at"]=>
array(2) {
[0]=>
string(9) "123456789"
[1]=>
string(7) "w@wp.pl"
}
}
}
fdfd
- Output for 8.3.5
- Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0
<pre>object(SimpleXMLElement)#1 (7) {
["@attributes"]=>
array(2) {
["id"]=>
string(1) "8"
["identyfikator"]=>
string(2) "23"
}
["name"]=>
string(5) "MAREK"
["recorder"]=>
string(1) "8"
["production-date"]=>
string(1) "0"
["registration-number"]=>
string(7) "SI40996"
["fuel"]=>
object(SimpleXMLElement)#2 (5) {
["type"]=>
object(SimpleXMLElement)#4 (0) {
}
["nominal"]=>
string(1) "0"
["drive"]=>
string(1) "0"
["work"]=>
string(1) "0"
["stay"]=>
string(1) "0"
}
["attr"]=>
object(SimpleXMLElement)#3 (1) {
["at"]=>
array(2) {
[0]=>
string(9) "123456789"
[1]=>
string(7) "w@wp.pl"
}
}
}
fdfd
- Output for 7.4.5
- <pre>object(SimpleXMLElement)#1 (7) {
["@attributes"]=>
array(2) {
["id"]=>
string(1) "8"
["identyfikator"]=>
string(2) "23"
}
["name"]=>
string(5) "MAREK"
["recorder"]=>
object(SimpleXMLElement)#2 (2) {
["@attributes"]=>
array(1) {
["ppp"]=>
string(4) "fdfd"
}
[0]=>
string(1) "8"
}
["production-date"]=>
string(1) "0"
["registration-number"]=>
string(7) "SI40996"
["fuel"]=>
object(SimpleXMLElement)#3 (5) {
["type"]=>
object(SimpleXMLElement)#5 (0) {
}
["nominal"]=>
string(1) "0"
["drive"]=>
string(1) "0"
["work"]=>
string(1) "0"
["stay"]=>
string(1) "0"
}
["attr"]=>
object(SimpleXMLElement)#4 (1) {
["at"]=>
array(2) {
[0]=>
object(SimpleXMLElement)#5 (2) {
["@attributes"]=>
array(2) {
["name"]=>
string(12) "PHONE_NUMBER"
["type"]=>
string(1) "5"
}
[0]=>
string(9) "123456789"
}
[1]=>
object(SimpleXMLElement)#6 (2) {
["@attributes"]=>
array(2) {
["name"]=>
string(5) "EMAIL"
["type"]=>
string(1) "5"
}
[0]=>
string(7) "w@wp.pl"
}
}
}
}
fdfd
- Output for 5.5.27 - 5.5.35, 5.6.11 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.16, 7.3.18 - 7.3.33
- <pre>object(SimpleXMLElement)#1 (7) {
["@attributes"]=>
array(2) {
["id"]=>
string(1) "8"
["identyfikator"]=>
string(2) "23"
}
["name"]=>
string(5) "MAREK"
["recorder"]=>
string(1) "8"
["production-date"]=>
string(1) "0"
["registration-number"]=>
string(7) "SI40996"
["fuel"]=>
object(SimpleXMLElement)#2 (5) {
["type"]=>
object(SimpleXMLElement)#4 (1) {
[0]=>
string(7) "
"
}
["nominal"]=>
string(1) "0"
["drive"]=>
string(1) "0"
["work"]=>
string(1) "0"
["stay"]=>
string(1) "0"
}
["attr"]=>
object(SimpleXMLElement)#3 (1) {
["at"]=>
array(2) {
[0]=>
string(9) "123456789"
[1]=>
string(7) "w@wp.pl"
}
}
}
fdfd
- Output for 7.3.17
- <pre>object(SimpleXMLElement)#1 (7) {
["@attributes"]=>
array(2) {
["id"]=>
string(1) "8"
["identyfikator"]=>
string(2) "23"
}
["name"]=>
string(5) "MAREK"
["recorder"]=>
object(SimpleXMLElement)#2 (2) {
["@attributes"]=>
array(1) {
["ppp"]=>
string(4) "fdfd"
}
[0]=>
string(1) "8"
}
["production-date"]=>
string(1) "0"
["registration-number"]=>
string(7) "SI40996"
["fuel"]=>
object(SimpleXMLElement)#3 (5) {
["type"]=>
object(SimpleXMLElement)#5 (1) {
[0]=>
string(7) "
"
}
["nominal"]=>
string(1) "0"
["drive"]=>
string(1) "0"
["work"]=>
string(1) "0"
["stay"]=>
string(1) "0"
}
["attr"]=>
object(SimpleXMLElement)#4 (1) {
["at"]=>
array(2) {
[0]=>
object(SimpleXMLElement)#5 (2) {
["@attributes"]=>
array(2) {
["name"]=>
string(12) "PHONE_NUMBER"
["type"]=>
string(1) "5"
}
[0]=>
string(9) "123456789"
}
[1]=>
object(SimpleXMLElement)#6 (2) {
["@attributes"]=>
array(2) {
["name"]=>
string(5) "EMAIL"
["type"]=>
string(1) "5"
}
[0]=>
string(7) "w@wp.pl"
}
}
}
}
fdfd
preferences:
175.61 ms | 404 KiB | 198 Q