w3resource
php Programming Exercies

PHP String Exercises: Print letters from 'a' to 'z'

PHP String: Exercise-26 with Solution

Write a PHP script to print letters from 'a' to 'z'.

Pictorial Presentation:

PHP String Exercises: Print letters from 'a' to 'z'

Sample Solution:

PHP Code:

<?php
for ($x = ord('a'); $x <= ord('z'); $x++)
 echo chr($x);
 echo "\n"
?>

Sample Output:

abcdefghijklmnopqrstuvwxyz

Flowchart :

Flowchart: Print letters from 'a' to 'z'

PHP Code Editor:

Have another way to solve this solution? Contribute your code (and comments) through Disqus.

Previous: Write a PHP script to remove comma(s) from the specified numeric string.
Next: PHP Math functions Exercises Home.

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming