3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $resultquery = <<<EOT Detail1||Response1||Status1::Detail2||Response2||Status2::Detail3||Response3||Status3::Detail4||Response4||St::Detail5||Response5||Status5::Detail6||Response6||Status6::Detail7||Response7||Status7::Detail8||Response8||Status8::Detail9||Response9||Status9::Detail10||Response10||Status10:: EOT; $pieces = explode("::",$resultquery); $countVal = count($pieces); $counter = 0; $rowCount = 0; while($counter<$countVal){ if($pieces[$counter]>'') { $pieces1 = explode("||", $pieces[$counter]); $pieces2 = explode("||", $pieces[$counter]); echo $pieces1[0]."<br>"; // detail echo $pieces2[1]."<br>"; // response } $counter++; $rowCount++; }
based on 9pkot
Output for 5.6.0 - 5.6.30, hhvm-3.18.5 - 3.22.0, 7.1.0 - 7.3.0alpha1
Detail1<br>Response1<br>Detail2<br>Response2<br>Detail3<br>Response3<br>Detail4<br>Response4<br>Detail5<br>Response5<br>Detail6<br>Response6<br>Detail7<br>Response7<br>Detail8<br>Response8<br>Detail9<br>Response9<br>Detail10<br>Response10<br>