You can use those 2 PHP functions (explained in the comments in the code):
ord() - Click HERE to read about it
and
chr() - Click HERE to read about it
Also - there is swapping between variables between lines #13 and #17;
You can read how to swap 2 variables in PHP HERE
Here is the code:
<?php
$first = readline();
$second = readline();
charsRange($first, $second);
function charsRange($f, $s) {
//ord() converts ascii value to its corresponding ascii number
$start = ord($f);
$end = ord($s);
if ($end < $start) {
$temp = $end;
$end = $start; //start is bigger
$start = $temp; //assigning value of the start
}
for ($i = $start + 1; $i < $end; $i++) {
echo chr($i) . " ";//chr() converts ascii number to its corresponding ascii value
}
}