i have a string like that:
test test test <span> hello </span> test test test <span> hello2 </span>
and i try to get the text between the span tags like:
array [
0 => 'hello',
1 => 'hello2
];
i tried:
$regex = '#<s*?spanb[^>]*>(.*?)</spanb[^>]*>#s';
$matches = [];
$item->text = preg_match($regex, $item->text, $matches);
but there i only get the first match: ‘hello’