3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* 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,', ) */ $item = ['id' => '183970', 'player1' => 'Weird', 'player2' => 'Bloodbuddy', 'player1_items' => '644:204,10:200000,', 'player2_items' => '38:200,', ]; $player1_items = explode(':', $item['player1_items']); foreach ($player1_items as $key => $value) { echo $value . PHP_EOL; }
Output for 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
644 204,10 200000,

preferences:
167.76 ms | 403 KiB | 170 Q