3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $chanstring = "\x01-07 / %x08-09 / %x0B-0C / %x0E-1F / %x21-2B / %x2D-39 / %x3B-FF"; function arrFromString($string) { $explosion = explode('-',$string); $lower = explode('',$explosion[0]); $upper = explode('',$explosion[1]); $arr = array(); $curr = $lower; while ($curr != $upper) { $arr[] = $curr; if (is_numeric($curr[1])) { $curr[1]++; if ($curr[1] > 9) { $curr[1] = 'A'; } } else { $curr[1] = chr(ord($curr[1]) + 1); if ($curr[1] === 'E') { $curr[1] = 0; if (is_numeric($curr[0])) { $curr[0]++; if ($curr[0] > 9) { $curr[0] = 'A'; } } else { $curr[1] = chr(ord($curr[1]) + 1); } } } } return $arr; } print_r(arrFromString('01-07'));
Output for 5.2.5 - 7.1.0
Warning: explode(): Empty delimiter in /in/SIB5f on line 8 Warning: explode(): Empty delimiter in /in/SIB5f on line 9 Array ( )
Output for 4.3.2 - 5.2.4
Warning: explode(): Empty delimiter. in /in/SIB5f on line 8 Warning: explode(): Empty delimiter. in /in/SIB5f on line 9 Array ( )
Output for 4.3.0 - 4.3.1
Warning: explode() [http://www.php.net/function.explode]: Empty delimiter. in /in/SIB5f on line 8 Warning: explode() [http://www.php.net/function.explode]: Empty delimiter. in /in/SIB5f on line 9 Array ( )