3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $urzadzenia_ilosc = 10; $zakres = '123-999'; $zakres = str_replace("-","",$zakres); echo "poczatek: ".$zakres."<br />"; $zakres_tmp = array(); for($i=0;$i<$urzadzenia_ilosc;$i++){ $zakres_tmp[] = "H-".substr($zakres, 0, 3)."-".substr($zakres, 3, 6); $zakres++; } print_r($zakres_tmp); ?>
based on C61Iu
Output for 4.3.0 - 5.6.28, hhvm-3.10.0 - 3.12.0, 7.0.0 - 7.1.0
poczatek: 123999<br />Array ( [0] => H-123-999 [1] => H-124-000 [2] => H-124-001 [3] => H-124-002 [4] => H-124-003 [5] => H-124-004 [6] => H-124-005 [7] => H-124-006 [8] => H-124-007 [9] => H-124-008 )