3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $adep = "SBGL"; $ades = "KMIA"; $result = "<tr><td>SBGL </td><td>KMIA </td><td>B763 </td><td>UM409 EKUBA UM409 DADOT UM409 VUMPI UM409 </td><td>959 </td><td>N0460 </td><td>310 </td><td>H </td><td>EET/SBBS0030 SBAZ0230 SVZM0425 </td></tr><tr><td class='alt'>SBGL </td><td class='alt'>KMIA </td><td class='alt'>B763 </td><td class='alt'>UM409 EKUBA UM409 DADOT UL304 ISANI UL304 </td><td class='alt'>727 </td><td class='alt'>N0490 </td><td class='alt'>360 </td><td class='alt'>H </td><td class='alt'>EET/SBBS0018 SBAZ0157 SVZM0400 </td></tr><tr><td>SBGL </td><td>KMIA </td><td>B763 </td><td>UM409 EKUBA UM409 DADOT UL304 ISANI </td><td>837 </td><td>N0470 </td><td>320 </td><td>H </td><td>EET/SBBS0030 SBAZ0230 SVZM0425 </td></tr><tr><td class='alt'>SBGL </td><td class='alt'>KMIA </td><td class='alt'>A332 </td><td class='alt'>UM409 EKUBA UM409 DADOT UM409 VUMPI UM409 </td><td class='alt'>849 </td><td class='alt'>N0480 </td><td class='alt'>360 </td><td class='alt'>H </td><td class='alt'>EET/SBBS0025 SBAZ0222 SVZM0442 </td></tr><tr><td colspan='9' align='center' class='alt'>4 registro(s) encontrado(s)</td></tr> "; preg_match_all("'<tr><td>".$adep." </td><td>".$ades." </td>(.*?)<\/tr>'si", $result, $match1); preg_match_all("'<tr><td class=\'alt\'>".$adep." </td><td class=\'alt\'>(.*?) </td>.*?<\/tr>'si", $result, $match2); print_r($match1); print_r($match2);
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
Array ( [0] => Array ( [0] => <tr><td>SBGL </td><td>KMIA </td><td>B763 </td><td>UM409 EKUBA UM409 DADOT UM409 VUMPI UM409 </td><td>959 </td><td>N0460 </td><td>310 </td><td>H </td><td>EET/SBBS0030 SBAZ0230 SVZM0425 </td></tr> [1] => <tr><td>SBGL </td><td>KMIA </td><td>B763 </td><td>UM409 EKUBA UM409 DADOT UL304 ISANI </td><td>837 </td><td>N0470 </td><td>320 </td><td>H </td><td>EET/SBBS0030 SBAZ0230 SVZM0425 </td></tr> ) [1] => Array ( [0] => <td>B763 </td><td>UM409 EKUBA UM409 DADOT UM409 VUMPI UM409 </td><td>959 </td><td>N0460 </td><td>310 </td><td>H </td><td>EET/SBBS0030 SBAZ0230 SVZM0425 </td> [1] => <td>B763 </td><td>UM409 EKUBA UM409 DADOT UL304 ISANI </td><td>837 </td><td>N0470 </td><td>320 </td><td>H </td><td>EET/SBBS0030 SBAZ0230 SVZM0425 </td> ) ) Array ( [0] => Array ( [0] => <tr><td class='alt'>SBGL </td><td class='alt'>KMIA </td><td class='alt'>B763 </td><td class='alt'>UM409 EKUBA UM409 DADOT UL304 ISANI UL304 </td><td class='alt'>727 </td><td class='alt'>N0490 </td><td class='alt'>360 </td><td class='alt'>H </td><td class='alt'>EET/SBBS0018 SBAZ0157 SVZM0400 </td></tr> [1] => <tr><td class='alt'>SBGL </td><td class='alt'>KMIA </td><td class='alt'>A332 </td><td class='alt'>UM409 EKUBA UM409 DADOT UM409 VUMPI UM409 </td><td class='alt'>849 </td><td class='alt'>N0480 </td><td class='alt'>360 </td><td class='alt'>H </td><td class='alt'>EET/SBBS0025 SBAZ0222 SVZM0442 </td></tr> ) [1] => Array ( [0] => KMIA [1] => KMIA ) )