PHP Programs List
Program 1 : Create a PHP page which accepts string from user. After submission that page displays the reverse of provided string.
Program 2 : WAP to sort an array (using built in php functions).
Program 3 : Write a menu driven PHP script that:
a. Removes the whitespaces from a string.
Sample string: ‘The quick ” ” brown fox’
Expected Output: Thequick'”‘brownfox
b. Checks if a string contains another string. (using built in php functions)
c. Checks if a string is all lower case. (using regex)
d. Replace the first ‘the’ of the following string with ‘That’.
Sample: ‘the quick brown fox jumps over the lazy dog.’
Expected Result: That quick brown fox jumps over the lazy dog.
Program 4 : Create a simple ‘birthday. countdown’ script, the script will count the number of days between current day and birth day.
Program 5 : $color = array(‘white’, ‘green’, ‘red’)
Write a PHP script which will display the colors in the following way:
Output: white, green, red,
Program 6 : Using switch case and dropdown list display a “Hello” message depending on the language selected in drop down list.
Program 7 : Create a login page having user name and password. On clicking submit, a welcome message should be displayed if the user is already registered (i.e. name is present in the database) otherwise error message should be displayed.
Program 8 : Write a PHP program to check that the entered email id of the form [email protected] is valid and the domain name is present in the database table.
Program 9 : Create a database table containing the marks of students in three subjects along with their roll number and name. Create a PHP page to display the mark sheet of the student along with the grade obtained.
Program 10 : Create a PHP page using functions for comparing three integers and print the largest number.
Program 11 : Write a function to calculate the factorial of a number (non-negative integer). The function accept the number as an argument.
Program 12 : WAP to check whether the given number is prime or not.
Program 13 : WAP to print first n even numbers.
Program 14 : Write a PHP script that finds out the sum of first n odd numbers.
Program 15 : Write a PHP script that checks whether a passed string is palindrome or not? (A palindrome is word, phrase, or sequence that reads the same backward as forward, e.g., madam or nurses run).
Program 16 : Write a PHP program to print Fibonacci series using recursion.
Program 17 : Create a script to construct the following pattern, using nested for loop.