Fatal error: Call to undefined function domxml_open_mem()

Discussion in 'PHP' started by anwarul.haque, Nov 26, 2007.

  1. #1
    Hi All,
    Can u give me exact solution for this error.

    Fatal error: Call to undefined function domxml_open_mem() in /home/test.php

    I'm Using This Code.
    $dom = domxml_open_mem($content);

    // DEFINE THE REGULAR EXPRESSION FOR GRABBING FIELDS
    $id_string = "/\<id-number\>.*\<\/id-number\>/";
    // GRAB THE ID VALUE
    preg_match($id_string, $content, $result);
    $id = $result[0];
    // REMOVE XML TAGS
    $id = preg_replace("/<.?id-number>/", '', $id);
    // PARSE REMAINING XML
    $responses = array(); // MAIN RESPONSE VALUES
    $qualifiers = array(); // ANY QUALIFIERS (INCLUDING RESPONSES)

    //$dom = domxml_open_mem($content);
    $dom = domxml_open_mem($content);

    $result_nodes = $dom->get_elements_by_tagname('response');
    foreach ($result_nodes as $node) {
    $key = $node->get_content();
    $responses[] = $key;
    }
    $results['responses'] = $responses;
    $qualifier_nodes = $dom->get_elements_by_tagname('qualifier');
    foreach ($qualifier_nodes as $node) {
    $key = $node->get_content();
    $qualifiers[] = $key;
    }
    $results['qualifiers'] = $qualifiers;
    //****************************
    echo "Resut 1" .$results['qualifiers'];

    echo "<br>";
    echo "Resut 2".$qualifiers;
    //****************************
    $dom->free();
     
    anwarul.haque, Nov 26, 2007 IP
  2. tarview

    tarview Peon

    Messages:
    7
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    What version of PHP? domxml_open_mem is only supported in PHP 4.2.1 and greater.
     
    tarview, Nov 26, 2007 IP
  3. serialCoder

    serialCoder Guest

    Best Answers:
    0
    #3
    yep, the error usually means the function that you are trying to use does not exist, either a custom one or built in
     
    serialCoder, Nov 26, 2007 IP