How do I find and print all the numbers between two numbers in PHP?

advertisements

Right now I'm asking the user for two numbers. I'm trying to print the numbers in between $one and $two assuming $one is smaller than $two.


Just a simple for loop should do the trick:

for($i=$a; $i<=$b; $i++) {
  echo $i;
}