Professional Documents
Culture Documents
PHP Practial File
PHP Practial File
PHP Practial File
A
AB
ABC
*
**
***
***
**
*
Output:
2. Write a program to demonstrate
local, global and static variables.
Input:
Output:
3. Write a program to check the area
of
i. Rectangle
ii. Circle
iii. Triangle
Input:
Output:
4. Write a program to swap two
numbers using print and echo.
Input:
Output:
Output:
8. WAP to create and print an
associative array.
Input:
Output:
Output:
11. WAP to check if two arrays contain
the same elements.
Input:
Ouput:
Output:
15. WAP to calculate the factorial of any
number using a while loop.
Input:
Output:
Output:
1
12
123
Input:
Output:
A
AB
ABC
Input:
Output:
*
**
***
Input:
Output:
***
**
*
Input:
Output:
18. WAP using else if ladder to generate
the gradings based on the inputted marks
by the user:
>=90: A
>=75 & <=89: B
>=60 & <=74: C
>=50 & <=59: D
<=49: E
Input:
Output:
19. WAP to demonstrate PHPINFO
function in environment variables :
INFO_CONFIGURATION
INFO_MODULE
INFO_ENVIRONMENT
INFO_VARIABLE
INFO_ALL
Input:
Output:
20. Create
an associative array using
countries as keys, states as values and
transform it into a 2-d array. Display
the data as a table.[html table tag]
Input:
Output: