- simplexml_load_string: documentation ( source)
<?php
echo "* XML:\n";
echo simplexml_load_string('<foo>123</foo>');
echo "\n---\n";
echo "* PHP <?= echo shortcut:\n";
echo simplexml_load_string('<foo>456<?= bar(); ?></foo>');
echo "\n---\n";
echo "* PHP <?php but no ?>:\n";
echo simplexml_load_string('<foo>789<?php baz();</foo>');
echo "\n---\n";
echo "* PHP block with the ending tag:\n";
echo simplexml_load_string('<foo>abc<?php abc(); ?></foo>');