I have XML content using SimpleXMLElement and var_dump results are appeared.
Sample Code:
$data = new SimpleXMLElement($xml);
$data->registerXPathNamespace('ns','http://endpoint.websitecom/');
$part = $data->xpath("//ns:return");
var_dump($part[0]->children("ns",true));
My Results:
object(SimpleXMLElement)[4]
public 'result' =>
object(SimpleXMLElement)[6]
public 'result' =>
object(SimpleXMLElement)[10]
public 'Code' => string '0' (length=1)
public 'amount' => string '2020.03' (length=7)
public 'code2' => string '3934.8' (length=6)
object(SimpleXMLElement)[8]
How Can I pass amount, code2 variables into PHP variables or array?
$amount = ?????
$code2 = ????