3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php //ovo dobijes iz baze $Sudjelovali='{"1":{"RBr":"1","Postrojba":"DVD Brdovec","Vozila":"Navalno vozilo","RegBr":"ZG-2543-GG","BrVatrog":"2"},"2":{"RBr":"","Postrojba":"DVD Zdenci","Vozila":"","RegBr":"","BrVatrog":""},"3":{"RBr":"","Postrojba":"","Vozila":"","RegBr":"","BrVatrog":""},"4":{"RBr":"","Postrojba":"itd","Vozila":"","RegBr":"","BrVatrog":""}}'; //tu ide u array $res=json_decode($Sudjelovali,true); //za svaku postrojbu, $i=1; foreach($res as $row) { echo "<tr>"; echo '<td> <input type="text" class="clsSudjelovaliPostrojba'.$i.'" name="txtSudjelovaliPostrojba_'.$i.'" style="width: 300px" value="'.$row['Postrojba'].'";/> </td>'."\r\n"; echo "</tr>"; $i++; } //
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
<tr><td> <input type="text" class="clsSudjelovaliPostrojba1" name="txtSudjelovaliPostrojba_1" style="width: 300px" value="DVD Brdovec";/> </td> </tr><tr><td> <input type="text" class="clsSudjelovaliPostrojba2" name="txtSudjelovaliPostrojba_2" style="width: 300px" value="DVD Zdenci";/> </td> </tr><tr><td> <input type="text" class="clsSudjelovaliPostrojba3" name="txtSudjelovaliPostrojba_3" style="width: 300px" value="";/> </td> </tr><tr><td> <input type="text" class="clsSudjelovaliPostrojba4" name="txtSudjelovaliPostrojba_4" style="width: 300px" value="itd";/> </td> </tr>
Output for 5.0.0 - 5.0.5, 5.1.1 - 5.1.6
Fatal error: Call to undefined function json_decode() in /in/LQfid on line 6
Process exited with code 255.
Output for 5.1.0
Fatal error: fatal flex scanner internal error--end of buffer missed in /in/LQfid on line 17
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: json_decode() in /in/LQfid on line 6
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: json_decode() in /in/LQfid on line 6
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: json_decode() in /in/LQfid on line 6