title: How to find tag name using phpquery?
body: <p>I am using phpquery to extract some data from a webpage. I need to identify the menu of the page. My implementation is to find each element that has sibilings > 0 and last-child is an <code>"a"</code>. My code is:</p>
  
  <pre><code>foreach($this-&gt;doc['*'] as $tagObj){
  $tag = pq($tagObj);
  if(count($tag-&gt;siblings()) &gt; 0){
      if($tag-&gt;find(":last-child")-&gt;tagName  === "a")
          echo trim(strip_tags($tag-&gt;html())) . "&lt;br/&gt;";
      }
  }
  </code></pre>
  
  <p>However, I am not getting any output because of </p>
  
  <blockquote>
    <p>$tag->find(":last-child")->tagName</p>
  </blockquote>
  
  <p>which isn't returning anything. What would be the reason for this?</p>