I came across the range function a few months ago, and it has saved so many lines of repetitive code. I got so tired of using for loops to do the most simple things.

Check out a few examples to see how this function can make your life so much easier.

Print all numbers from a to z:

foreach(range('a', 'z') as $letter) {
    echo $letter;
}

Print all numbers from 0 to 12

foreach(range(0, 12) as $number) {
    echo $number;
}

Print all numbers from 0 to 100, but only showing every 10th one.

foreach(range(0, 100, 10) as $number) {
    echo $number;
}