I have some strings:
$string1 = '<p><strong>Extract me</strong></p><p>Leave me</p>';
$string2 = '<strong>Extract me</strong>Leave me';
$string3 = '<span style="font-weight: bold">Extract me</span><br /><span>Leave me</span>';
Let's check $string3:
The first tag of the string is <span>
So the text between the first <span>
and the first </span>
wants to be extracted.
Extracted shall mean: remove it from $stringX and save it into $extractedX
How would I do this?