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\'>".$ades." </td>(.*?)<\/tr>'si", $result, $match2); foreach($match1[2] as $rota) { preg_match("'<td>(.*?)<\/td>'si", $rota, $match_rota1); echo $match_rota1[1]; } foreach($match2[2] as $rota) { preg_match("'<td class=\'alt\'>(.*?)<\/td>'si", $rota, $match_rota2); echo $match_rota2[1]; }
Output for 5.3.0 - 7.1.0
Notice: Undefined offset: 2 in /in/MGFEr on line 12 Warning: Invalid argument supplied for foreach() in /in/MGFEr on line 12 Notice: Undefined offset: 2 in /in/MGFEr on line 21 Warning: Invalid argument supplied for foreach() in /in/MGFEr on line 21
Output for 5.2.1 - 5.2.17
Notice: Undefined offset: 2 in /in/MGFEr on line 12 Warning: Invalid argument supplied for foreach() in /in/MGFEr on line 12 Notice: Undefined offset: 2 in /in/MGFEr on line 21 Warning: Invalid argument supplied for foreach() in /in/MGFEr on line 21
Output for 4.3.0 - 4.3.10, 4.4.0 - 5.2.0
Warning: Invalid argument supplied for foreach() in /in/MGFEr on line 12 Warning: Invalid argument supplied for foreach() in /in/MGFEr on line 21
Output for 4.3.11