How can I run a loop in PHP to iterate alphabets from a-z
?
Something like that:
for( $i ='a'; $i <= 'z'; $i++ ) {
echo "<br>".$i;
}
Simply use range
function of PHP
foreach(range('a','z') as $v){
echo "$v \n";
}
You can use range:
<?php
foreach(range('a','z') as $letter)
{
echo "$letter<br/>";
}
in addition you can store in array:
$alphas = range('a', 'z');
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With