title: How to get the Value of Attributes in HTML tags using PHP
body: <p>I have a string such like</p>
  
  <pre><code>$str = '&lt;a href="http://www.example.com/example_link"&gt;This is the Example Link&lt;/a&gt;';
  </code></pre>
  
  <p>I want to get the href value <code>(http://www.example.com/example_link)</code> and the text value <code>(This is the Example Link)</code> from the above string in php</p>
  
  <p>How can I get these values from the string, Any Efficient way. Do I need to use PHP DOM or REGEX?</p>
  
  <p>Note: There could be more than one occurrences of an anchor <code>&lt;a&gt;</code> tag in a string.</p>