title: php regex to get string inside href tag
body: <p>I need a regex that will give me the string inside an href tag and inside the quotes also.</p>
  
  <p>For example i need to extract theurltoget.com in the following:</p>
  
  <pre><code>&lt;a href="theurltoget.com"&gt;URL&lt;/a&gt;
  </code></pre>
  
  <p>Additionally, I only want the base url part.  I.e. from <code>http://www.mydomain.com/page.html</code> i only want <code>http://www.mydomain.com/</code></p>