title: Creating DOMDocument: match one certain element in a PHP-parser
body: <p>good evening dear Community, </p>
  
  <p>Well first of all: felize Navidad - I wanna wish you a Merry Christmas!! In my season-break i am workin on a little parser-script. </p>
  
  <p>Today i'm trying to debug a little DOMDocument object in php. Ideally it'd be nice if 
  I could get DOMDocument to output in a array-like format, to store the data 
  in a database!</p>
  
  <p>My example: <a href="http://schulen.bildung-rp.de/gehezu/startseite/einzelanzeige.html?tx_wfqbe_pi1%5buid%5d=60119" rel="nofollow">head over to the url - see the example: the target</a></p>
  
  <p>I want to filter out the data in the block:</p>
  
  <pre><code>Schulart: BBS
  Schulnummer:60119
  Anschrift: Berufsbildende Schule Boppard Antoniusstr. 21; 56154 Boppard
  Telefon: (0 67 42) 80 61-0
  Telefax: (0 67 42) 80 61-29
  E-Mail: sekretary@bbs-boppard.de
  Internet: website 
  Träger:Kreisverwaltung Rhein-Hunsr&amp;#65533;ck-Kreis
  letzte Änderung: 08 Feb 2010 14:33:12 von 60119
  </code></pre>
  
  <p>I have investigated the sourcecode - and found out that the attribute of interest should 
  be this one:
   <code>class="content"div class="content"&gt;&lt;!-- TYPO3SEARCH_begin --&gt;</code>
  or even better: <code>wfqbeResults</code></p>
  
  <p>So if i run the DOMDucument way i can use this like so: </p>
  
  <pre><code>$dom-&gt;getElementById('wfqbeResults');
  </code></pre>
  
  <p>here the code is: - my trails</p>
  
  <pre><code>&lt;?php
  
  $dom = new DOMDocument();
  @$dom-&gt;loadHTMLFile(' -&gt; here the website goes in&lt;- ');
  $divElement = $dom-&gt;getElementById('wfqbeResults');
  
  $innerHTML= '';
  $children = $divElement-&gt;childNodes;
  foreach ($children as $child) {
     $innerHTML .= $child-&gt;ownerDocument-&gt;saveXML( $child );
  } 
  echo $innerHTML;
  
  &lt;?
  </code></pre>
  
  <p>Duhh: this outputs lot of garbage. The code spits out a lot of html anyway. I have to 
  overhaul the code a bit to get the wanted 9 lines out of the parser: </p>
  
  <p><strong>what is aimed:</strong> i want to get out the following: </p>
  
  <p><strong>a.</strong> 9 lines with nine labels and nine values.
  <strong>b.</strong> I want to prepare the output to store it in a MySQL-DB!</p>
  
  <p>Look forward to some hints 
  greetings zero</p>