title: PHP Simple HTML DOM Parser
body: <p>How come you can't use the Class's traversing methods with variable's to set the parameters</p>
  
  <p>For instance Using this array:</p>
  
  <pre><code>array(0 =&gt; array('element' =&gt; 'img[src=images/more.gif]', 'attribute' =&gt; 'parent()-&gt;href'));
  </code></pre>
  
  <p>this works:</p>
  
  <pre><code>foreach($this-&gt;contents-&gt;find($target[$key]['element']) as $keyz =&gt; $found) 
  {
   $this-&gt;store[$keyz] = $found-&gt;parent()-&gt;href
  }
  </code></pre>
  
  <p>But this doesn't:</p>
  
  <pre><code>foreach($this-&gt;contents-&gt;find($target[$key]['element']) as $keyz =&gt; $found) 
      {
       $this-&gt;store[$keyz] = $found-&gt;$target[$key]['attribute'];
      }
  </code></pre>
  
  <p>I have tried changing they array like so:</p>
  
  <pre><code>array(0 =&gt; array('element' =&gt; 'img[src=images/more.gif]', 'traverse' =&gt; 'parent()', 'attribute' =&gt; 'href')
  </code></pre>
  
  <p>And then trying:</p>
  
  <pre><code>foreach($this-&gt;contents-&gt;find($target[$key]['element']) as $keyz =&gt; $found) 
          {
           $this-&gt;store[$keyz] = $found-&gt;$target[$key]['traverse']-&gt;$target[$key]['attribute'];
          }
  </code></pre>
  
  <p>doesn't work.</p>
  
  <p>On both failures a print_r($this->store) simply gives Array();</p>