Sie sind hier : sebastian1012.bplaced.net/ homepage-neu / Kurze-Scripte-und-Codeschnipsel / index.php

Zurück


Der Quellcode dazu


loadHTMLFile($file);

$xpath = new DOMXpath($doc);

// example 1: for everything with an id
//$elements = $xpath->query("//*[@id]");

// example 2: for node data in a selected id
//$elements = $xpath->query("/html/body/div[@id='yourTagIdHere']");

// example 3: same as above with wildcard
$elements = $xpath->query("/html/body/div");

if (!is_null($elements)) {
  foreach ($elements as $element) {
    echo "
[". $element->nodeName. "]"; $nodes = $element->childNodes; foreach ($nodes as $node) { echo $node->nodeValue. "\n"; } } } ?>

Add Comment

* Required information
1000
Powered by Commentics

Comments (1)

Gravatar
Admin
Sascha65says...

Die Canvas Balken Uhr ist ja mal Fett