Functions are a combined set of a bunch of expressions placed at a place. These expressions are performed again and again as per use by passing the value to the it as arguments, if any. It uses these values to calculate the result and finally returns it to the calling part of the document. However, there could also be some functions which do not return anything and their aim is to make some changes in the value of some global variables. Here is a sample of user-defined function.

	function printName($first_name, $second_name){
	    echo "Hi friend, your name is ";
		echo $first_name;
		echo " ";
		echo $second_name;
		printName(Manmohan, Singh); // calling fn 


We will mention some more use of functions in the applications we will be presenting at the end. We will see another inportant and nice feature of PHP, error handling.

Member Login

Member Login

Not a Member? Sign Up!

Login to comment

Be the first to comment on this topic


<<< Wanna review

Continue >>>