Skip to content

ravi-prakash1907/PHP-Practicles

Repository files navigation

PHP-Practicles

It holds all the practicals as per the syllabus of University of Delhi's B.Sc. (Hons.) Computer Science course.

Practical List

  1. Create a PHP page using functions for comparing three integers and print the largest number.
  2. Write a function to calculate the factorial of a number (non-negative integer). The function accept the number as an argument.
  3. WAP to check whether the given number is prime or not.
  4. Create a PHP page which accepts string from user. After submission that page displays the reverse of provided string.
  5. Write a PHP function that checks if a string is all lower case.
  6. 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)
  7. WAP to sort an array.
  8. Write a PHP script that removes the whitespaces from a string.Sample string : 'The quick " " brown fox' Expected Output : Thequick""brownfox
  9. Write a PHP script that finds out the sum of first n odd numbers.
  10. 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.
  11. Write a PHP script that checks if a string contains another string.
  12. Create a simple 'birthday countdown' script, the script will count the number of days between current day and birth day.
  13. Create a script to construct the following pattern, using nested for loop.
*  
* *  
* * *  
* * * *   
* * * * *     
  1. Write a simple PHP program to check that emails are valid.
  2. WAP to print first n even numbers.
  3. $color = array('white', 'green', 'red'') Write a PHP script which will display the colors in the following way :
    Output :

white, green, red

• green
• red
• white

  1. Using switch case and dropdown list display a “Hello” message depending on the language selected in drop down list.
  2. Write a PHP program to print Fibonacci series using recursion.
  3. Write a PHP script to 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

It holds all the practicles as per the syllabus of University of Delhi's B.Sc. (Hons.) Computer Science course.
In order to run this project, the very first task, that has to be done is: you need to rename main.php to index.php