All PHP Loop programs with examples

PHP is a server scripting language, and It is a powerful tool for making interactive and dynamic Web-pages. I have used WampServer 2.2 for following example.

 

  1. Write a PHP script that displays 1 2 3 4 5 6 7 8 9 10 numbers on one line
  2. Write a PHP script using a for loop to add all the integers between 0 and 20 and display the sum
  3. Write a PHP script to calculate and print the factorial of a number using a for loop
  4. Write a program which will count the “t” characters in the text “techstudy”
  5. Write a PHP script using nested for loop that creates a chess board
  6. Write a PHP script to print all even numbers between 1 to 10
  7. Write a PHP script to print all odd numbers between 1 to 10
  8. Write a PHP Script to sum of even numbers from 1 to 10
  9. Write a PHP Script to sum of odd numbers from 1 to 10
  10. Write a PHP program to print table of number

Leave a Comment