title: How to get last li's anchor tag with simple dom html in php
body: <p>I am crawling a web with the help of simple dom in PHP.</p>
  
  <p>I am getting following html with the help curl:</p>
  
  <pre><code>&lt;ul&gt;&lt;li&gt;1&lt;/li&gt;&lt;li&gt;2&lt;/li&gt;&lt;li&gt;3&lt;/li&gt;&lt;li&gt;&lt;a href="http:abc.com"&gt;4&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;
  </code></pre>
  
  <p>Now, I need to href (link) of anchor tag which is in the last li of this ul with the help of simple dom object. Please provide me syntax how can I do this?</p>
  
  <p>I have tried with the following code but i am not able to find the last li...</p>
  
  <pre><code>require_once 'simple_html_dom.php';
          $html = "&lt;ul&gt;&lt;li&gt;1&lt;/li&gt;&lt;li&gt;2&lt;/li&gt;&lt;li&gt;3&lt;/li&gt;&lt;li&gt;&lt;a href="http:abc.com"&gt;4&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;";
          $oDocumentModel = new simple_html_dom();
          $oDocumentModel-&gt;load($html);
          $ul = $oDocumentModel-&gt;find('ul',0);
  </code></pre>