3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = "Seats: 11;12; Name: qqqq;wwww; Start: Прешов, АВ Košická 2725/2 End: Мукачево, АЗ Лавковская, 1б Date: 2019-06-22 Time: 09:40 PM"; $lines = explode("\n", trim($str)); $data = array_reduce($lines, function($res, $line){ [$key, $value] = preg_split('#\s*:\s*#', $line, 2); $res[$key] = $value; return $res; }, []); var_dump($data); preg_match_all('#(\d+);#', $data['Seats'], $m); var_dump($m[1]);
Output for 7.1.25 - 7.1.33, 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.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
array(6) { ["Seats"]=> string(6) "11;12;" ["Name"]=> string(10) "qqqq;wwww;" ["Start"]=> string(35) "Прешов, АВ Košická 2725/2" ["End"]=> string(48) "Мукачево, АЗ Лавковская, 1б" ["Date"]=> string(10) "2019-06-22" ["Time"]=> string(8) "09:40 PM" } array(2) { [0]=> string(2) "11" [1]=> string(2) "12" }

preferences:
170.37 ms | 404 KiB | 184 Q