Difference between revisions of "Spring 2020: PHP Programming Lab"
Jump to navigation
Jump to search
| Line 53: | Line 53: | ||
| 3 || Write a PHP script that checks whether a passed string is palindrome of not? (A Palindrome is word, phrase, or sequence that reads the same backward as forward. For example: mom, dad, madam, Step on no pets, nurses run || Practice Set No. 15 || | | 3 || Write a PHP script that checks whether a passed string is palindrome of not? (A Palindrome is word, phrase, or sequence that reads the same backward as forward. For example: mom, dad, madam, Step on no pets, nurses run || Practice Set No. 15 || | ||
|- | |- | ||
| − | | 4 || | + | | 4 || $color = array("white","green","red") <br> |
| − | + | Write a PHP script which will display the colors in the following way: <br> | |
| − | + | Output:<br> | |
| − | + | white, green, red,<br> | |
| − | + | * green | |
| + | * red | ||
| + | * white | ||
|| Practice Set || | || Practice Set || | ||
|- | |- | ||
| − | | 5 || | + | | 5 || Write a PHP script which will perform string manipulation using in-built functions. || || |
|} | |} | ||
Revision as of 00:44, 13 January 2020
- Instructions
- Please be on time to avoid the attendance penalty.
- Turn off(shutdown) your assigned computer after finishing your work (or before you leave the lab).
- Please arrange the chair in proper place while leaving the lab.
- Please put your phone in silent mode.
Contents
Lab 1: Getting Started ( week of 6th/7th January 2020 )
- Brief introduction to PHP [Download]
| Q. NO. | Program | Lab Exercise No. | Remarks |
|---|---|---|---|
| 1 | WAP to print first n even numbers | Practice Set No. 13 | |
| 2 | WAP to find sum of first n odd numbers | Practice Set No. 14 | |
| 3 | WAP to check whether the given number is prime or not | Practice Set No. 12 | |
| 4 | WAP to print the following pattern using nested for loop:* |
Practice Set No. 17 | |
| 5 | WAP to sort an array using built in PHP function | Lab Exercise No. 2 |
Lab 2: ( week of 13th/14th January 2020 )
- Arrays, Strings and Functions in PHP [Download]
| Q. NO. | Program | Lab Exercise No. | Remarks |
|---|---|---|---|
| 1 | Create a PHP page using functions for comparing three integers and print the largest number | Practice Set No. 10 | |
| 2 | Write a function to calculate the factorial of a number(non-negative integer). The function accepts the number as an argument | Practice Set No. 11 | |
| 3 | Write a PHP script that checks whether a passed string is palindrome of not? (A Palindrome is word, phrase, or sequence that reads the same backward as forward. For example: mom, dad, madam, Step on no pets, nurses run | Practice Set No. 15 | |
| 4 | $color = array("white","green","red") Write a PHP script which will display the colors in the following way:
|
Practice Set | |
| 5 | Write a PHP script which will perform string manipulation using in-built functions. |
Lab 3: ( week of 20th/21st January 2020 )
- Lab Assignment
Lab 4: ( week of 27th/28th January 2020 )
- Lab Assignment