PHP User Defined Functions

Back To PHP Index


1. php program to demonstrate user defined function,create a function to display hello world on the screen - Code
2. php program to create a function that checks whether a number is even or odd (number is passed to function as argument) - Code
3. php program to create a function to find factorial of number passed to function as argument - Code
4. php program to find create a function to check whether a number passed to it as argument is prime or not - Code
5. php program to create a function that prints the table of the number passed to it as argument - Code
6. php program to create a function that takes two integers arguments and calculates their sum - Code
7. php program to create a function that takes two integer arguments calculates difference between them - Code
8. php program to create a function that inputs two numbers and finds their product - Code
9. php program to create a function that takes two integer arguments and finds largest of them - Code
10. php program to create a function that takes three integer arguments and finds largest of them - Code
11. php program to create a function that takes three integer arguments and finds smallest of them - Code
12. php program to create two functions to calculate area and perimeter of rectangle (length and breadth of rectangle are passed to functions as arguments) - Code
13. php program to create two functions that find area and circumference of circle (radius of circle is passed to functions as argument) - Code
14. php program to create two functions to find area and perimeter of square (side of square is passed to functions as argument) - Code
15. php program to create a function that finds volume of a box (width, depth and height of box are passed to function as arguments) - Code
16. php program to create a function that check whether character passed to it as argument is vowel or not using switch case statement - Code
17. php program to create a function that calculates sum of numbers between two numbers a and b (a nd b are passed to function as integer arguments ) - Code
18. php program to create two functions that prints the three numbers in ascending order and descending order passed to functions as arguments - Code
19. program to create two functions that prints sum of even numbers and odd numbers between two numbers a and b (a nd b are passed to functions as integer arguments ) - Code
20. php program to create a function to calculate simple interest based on principal amount,rate of interest - Code
21. php program to create a function that accepts default arguments - Code
22. php program to create a function that returns a value - Code
23. php program to create a static variable - Code
24. php program to create a function that display hello world for a specified number of times- Code
25. php program to create a function that inputs price and rate of discount from the user and calculates discount amount - Code
26. php program to create a function that returns factorial of a number passed to it as argument - Code
27. php program to create a function that returns area of circle based on radius passed to function as argument - Code
28. program to create a function that returns sum of numbers between a and b passed to function as integer arguments - Code
29. php program to create a function that returns largest of three numbers passed to it as arguments - Code
30. php program to create a function that returns smallest of three numbers passed to function as integer arguments - Code
31. php program to create a function that returns volume of box based on width,depth and height passed to function as integer arguments - Code
32. php program to create a function that finds yearly salary based on monthly salary passed to function as integer argument - Code