Answers for "how to get attribute value in xml using php"

PHP
0

how to get attribute value in xml using php

$xml=simplexml_load_file($file);
foreach($xml->Var[0]->attributes() as $a => $b) {
    echo $a,'="',$b,"\"\n";
}

$attr = $xml->Var[0]->attributes();
echo $attr['my_var'];
Posted by: Guest on April-17-2021

Code answers related to "how to get attribute value in xml using php"

Browse Popular Code Answers by Language