3v4l.org

run code in 300+ PHP versions simultaneously
<?php $result = $db->query('SELECT * FROM table.logs ORDER BY time DESC LIMIT 2'); while ($item = $db->fetch_assoc($result)) { /* data (var_export) array ( 'id' => '183970', 'player1' => 'Weird', 'player2' => 'Bloodbuddy', 'player1_items' => '644:204,10:200000,', 'player2_items' => '38:200,', )array ( 'id' => '183969', 'player1' => 'Frog', 'player2' => 'Eh', 'player1_items' => '656:1,11:3797,33:1111,42:200,40:100,31:1111,1263:1,522:1,', 'player2_items' => '405:1,', ) */ $player1_items = explode(':', $item['player1_items']); foreach ($player1_items as $key => $value) { echo $value; } }

preferences:
53.65 ms | 402 KiB | 5 Q