I'm trying to extract the text between class="green"> and </a>, and put any matches in an array. Later, I will extract just the text inbetween, as that's no problem. Here's what I have, which isn't working:
Code: Select all
$String = '<a href="blablabla" class="green">Text that I want to extract</a>';
$SearchPattern = "/class=\"green2\">.+</";
preg_match_all ( $SearchPattern, $String, $Results );
print_r($Results );
// results in Array ( [0] => Array ( ) )