1
I get a string in PHP and need to fetch the values of Ids, can be 1, how can be 100 ID’s, how to do? I tried something like this:
$texto = 'Nome1 <span id="indicado-b">Camila</span> Nome2 <span id="indicado-c">Walter</span>';
preg_match_all('/<span id="indicado-(.*)">/',$texto, $match);
print_r($match);
The amount I need to receive is b and c, which are the values of the ID, but it is not returning this, I get:
Array ( [0] => Array ( [0] => Camila Nome2 ) [1] => Array ( [0] => b">Camila Nome2