I am trying to determine whether the function domxml_open_mem and xpath_new_context is available under version PHP V4.3.0 or not. I am using IIS7 under windows 7.
I am reading the document from http://www.php.net/manual/en/function.domxml-open-mem.php
it seemed like the the those functions are available these version.
I’ve tried to test this under multiple PHP versions from 4.1.2 to 4.3.0 and the results are those function are not available.
if (function_exists('domxml_open_mem')) {
echo "Function is available.<br />\n";
} else {
echo " Function is not available.<br />\n";
}
Any ideas?
My goal is to parse the value from the xml from the string below
$xml_String="<xml><Fields><Header>aa</Header><Header>bb</Header></Fields></xml>";
and display back
//The code need to be compatible from 4.3.0 to the latest versions.
$xpresult = xpath_eval($xml_String, "/xml/Fields/Header");
foreach ($xpresult->nodeset as $node)
{
$newxml .= $node->dump_node($node);
}
I suppose it hasn’t been compiled into your version of PHP: