- simplexml_load_string: documentation ( source)
<?php
// Does NOT work as expected.
$sxml = simplexml_load_string('<test><num>20.5</num><den>1</den></test>');
$ans = $sxml->num / $sxml->den;
echo "XML Test:\n";
echo "{$sxml->num} / {$sxml->den} = {$ans}\n";
// Output: 20.5 / 1 = 20