A Php program to alphabet triangle using range() method. The range() function is a PHP built-in function that creates an array of elements of any kind, such as integers and alphabets, within a particular range (from low to high), i.e. the list’s first entry is considered low and the last element is considered high. array range is the syntax.
$alpha = range('A', 'Z');
for($i=0; $i<5; $i++)
for($j=5; $j>$i; $j--)
What is range() function in php
The range() function returns an array with a specified number of entries. This function returns an array of elements arranged in ascending order from low to high. The range array will be from high to low if the low value is greater than the high parameter. The range() method in PHP is used to produce an array of elements of any type, such as integers or alphabets, within a particular range, where the first element of the list is considered low and the last element is considered high.