I have a string of HTML that I would like to check to see if there are any links inside of it and, if so, extract them and put them in an array. I can do this in jQuery with
One line solution
$href = (string)( new SimpleXMLElement($your_html_tag))['href'];