@ 2014-08-04T11:33:31Z <?php
$xml = <<< EOT
<?xml version='1.0' encoding='UTF-8'?>
<char cp="0000" age="1.1" na="" JSN="" gc="Cc" ccc="0" dt="none"
dm="#" nt="None" nv="NaN" bc="BN" bpt="n" bpb="#" Bidi_M="N" bmg=""
suc="#" slc="#" stc="#" uc="#" lc="#" tc="#" scf="#" cf="#" jt="U"
jg="No_Joining_Group" ea="N" lb="CM" sc="Zyyy" scx="Zyyy" Dash="N"
WSpace="N" Hyphen="N" QMark="N" Radical="N" Ideo="N" UIdeo="N" IDSB="N"
IDST="N" hst="NA" DI="N" ODI="N" Alpha="N" OAlpha="N" Upper="N"
OUpper="N" Lower="N" OLower="N" Math="N" OMath="N" Hex="N" AHex="N"
NChar="N" VS="N" Bidi_C="N" Join_C="N" Gr_Base="N" Gr_Ext="N" OGr_Ext="N"
Gr_Link="N" STerm="N" Ext="N" Term="N" Dia="N" Dep="N" IDS="N" OIDS="N"
XIDS="N" IDC="N" OIDC="N" XIDC="N" SD="N" LOE="N" Pat_WS="N" Pat_Syn="N"
GCB="CN" WB="XX" SB="XX" CE="N" Comp_Ex="N" NFC_QC="Y" NFD_QC="Y"
NFKC_QC="Y" NFKD_QC="Y" XO_NFC="N" XO_NFD="N" XO_NFKC="N" XO_NFKD="N"
FC_NFKC="#" CI="N" Cased="N" CWCF="N" CWCM="N" CWKCF="N" CWL="N" CWT="N"
CWU="N" NFKC_CF="#" InSC="Other" InMC="NA" blk="ASCII" isc="" na1="NULL">
<namealias alias="NUL" type="abbreviation" />
<namealias alias="NULL" type="control" />
</char>
EOT;
$simpleXML = simplexml_load_string($xml); // Load XML string data into the simplexml object parser
foreach ($simpleXML->result->rowset->row as $row) {
$titles = [];
$name = $row['name']->__toString();
foreach($row as $attrib){
if($attrib['name']->__toString() === 'titles'){
foreach($attrib as $title){
$titles[] = $title['titleName']->__toString();
}
}
}
echo $name . ' : ' . implode(' - ', $titles) . "<br/>\n";
}
Enable javascript to submit You have javascript disabled. You will not be able to edit any code.
Output for 8.0.0 - 8.0.30 , 8.1.0 - 8.1.28 , 8.2.0 - 8.2.18 , 8.3.0 - 8.3.6 Warning: Attempt to read property "row" on null in /in/62Qv4 on line 25
Warning: foreach() argument must be of type array|object, null given in /in/62Qv4 on line 25
Output for 7.2.0 - 7.2.33 , 7.3.0 - 7.3.31 , 7.4.0 - 7.4.33 Notice: Trying to get property 'row' of non-object in /in/62Qv4 on line 25
Warning: Invalid argument supplied for foreach() in /in/62Qv4 on line 25
Output for 7.3.32 - 7.3.33 Warning: Invalid argument supplied for foreach() in /in/62Qv4 on line 25
Output for 5.4.0 - 5.4.45 , 5.5.0 - 5.5.38 , 5.6.0 - 5.6.40 , 7.0.0 - 7.0.33 , 7.1.0 - 7.1.33 Notice: Trying to get property of non-object in /in/62Qv4 on line 25
Warning: Invalid argument supplied for foreach() in /in/62Qv4 on line 25
Output for 4.4.3 - 4.4.9 , 5.1.0 - 5.1.1 , 5.1.3 - 5.1.6 , 5.2.0 - 5.2.17 , 5.3.0 - 5.3.29 Parse error: syntax error, unexpected '[' in /in/62Qv4 on line 26
Process exited with code 255 . Output for 4.4.2 , 5.1.2 Parse error: syntax error, unexpected '[' in /in/62Qv4 on line 27
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 '[' in /in/62Qv4 on line 26
Process exited with code 255 . Output for 4.3.2 - 4.3.4 Parse error: parse error in /in/62Qv4 on line 26
Process exited with code 255 . preferences:dark mode live preview
326.7 ms | 401 KiB | 455 Q