fork download
  1. <?php
  2.  
  3. $textMostraMarcado = '3 3 1 6 8 6 8 <b>1 1 1 </b>2 4 2 7 5 <b>4 4 4 4 </b>9 <b>8 8 8 </b>7';
  4.  
  5. if (preg_match_all("/<b>.*?<\/b>/", $textMostraMarcado, $matches))
  6. {
  7. print_r($matches[0]);
  8. }
Success #stdin #stdout 0.01s 82944KB
stdin
Standard input is empty
stdout
Array
(
    [0] => <b>1 1 1 </b>
    [1] => <b>4 4 4 4 </b>
    [2] => <b>8 8 8 </b>
)