Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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,""
";
}

$attr = $xml->Var[0]->attributes();
echo $attr['my_var'];
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #attribute #xml #php
ADD COMMENT
Topic
Name
5+7 =