title: PHP DomXPath - Get Child by Class
body: <p>So far, my code is getting all classes 'forumRow' using a xPath query. How would I get the href-attribute of the a-element which exists once in every 'forumRow' class?</p>
  
  <p>I'm kinda stuck at the point where I can run a query starting from the result of the first query.</p>
  
  <p>My current code</p>
  
  <pre><code>            $this -&gt; boards = array();
              $html = @file_get_contents('http://www.roblox.com/Forum/Default.aspx');
  
              libxml_use_internal_errors(true);
              $page = new DOMDocument();
              $page -&gt; preserveWhiteSpace = false;
              $page -&gt; loadHTML($html);
  
              $xpath = new DomXPath($page);
              $board_array = $xpath -&gt; query('//*[@class="forumRow"]');
  
              foreach($board_array as $board)
              {
                  $childNodes = $board -&gt; childNodes;
                  $boardName = $childNodes -&gt; item(0) -&gt; nodeValue;
  
                  if (strlen($boardName) &gt; 0)
                  {
  
                      $boardDesc = $childNodes -&gt; item(1) -&gt; nodeValue;
                      array_push($this -&gt; boards, array($boardName, $boardDesc));
                  }
              }
              $Cache -&gt; saveData(json_encode($this -&gt; boards));
  </code></pre>