PHP Practice Questions on Functions

 

PHP PRACTICE QUESTIONS ON FUNCTIONS

 

 

 

Practice Questions - User defined functions in PHP.

These questions give you how to use a basic PHP function. You will also learn how to use loops and some string functions inside the function. Before attempting these questions, first visit our tutorials on PHP functions.




1. Write a function for find big number

$a = 5;
$b
= 6;
$c
= 2;


2. Write a function to check a given string is empty or not

$username = "";


Hint--use strlen function


3. Print sum of 1..10 digits using for loop inside the function


5. Find given number is available in the array or not

$n
= 5
$numbers = array(6,3,5,4,6,7);

Try with both with built-in function/ without built-in function

6. A function that will coverts a given name into upper case (use strtoUpper bultin function) inside your function

$cityname = "hyderabad";

7. print "Hello" 10 times using function and for loop.

8. print all alphabets A-Z using for loop and using chr() builtin function.


 

 

 PHP HOME

Tags:

PHP Practice Questions | PHP Mock Test | PHP Mock Exam Questions |PHP Quiz Questions

 

Comments

Popular posts from this blog

Using javascript pass form variables to iframe src

Creating a new PDF by Merging PDF documents using TCPDF

Import excel file into mysql in PHP