update page now

Voting

: min(seven, two)?
(Example: nine)

The Note You're Voting On

nospam at ya dot ru
16 years ago
<?PHP
function dom2array_full($node){ 
    $result = array(); 
    if($node->nodeType == XML_TEXT_NODE) { 
        $result = $node->nodeValue; 
    } 
    else { 
        if($node->hasAttributes()) { 
            $attributes = $node->attributes; 
            if(!is_null($attributes))  
                foreach ($attributes as $index=>$attr)  
                    $result[$attr->name] = $attr->value; 
        } 
        if($node->hasChildNodes()){ 
            $children = $node->childNodes; 
            for($i=0;$i<$children->length;$i++) { 
                $child = $children->item($i); 
                if($child->nodeName != '#text') 
                if(!isset($result[$child->nodeName])) 
                    $result[$child->nodeName] = dom2array($child); 
                else { 
                    $aux = $result[$child->nodeName]; 
                    $result[$child->nodeName] = array( $aux ); 
                    $result[$child->nodeName][] = dom2array($child); 
                } 
            } 
        } 
    } 
    return $result; 
} 
?>

<< Back to user notes page

To Top