I'm looking to return the value that is nested in the an element containing an href value with john
in it (in this example, it is 7 goals
). Any help?
<?php
$html_string = '<div class="foo"><a href="../john-smith.html"><span>7 goals</span></a></div><div class="foo2"><h2><a href="../adam-green.html">8 points</a></h2></div>';
echo $isolated_character;