Home Tutorial Php Phpfunctions PHP Functions, PHP Functions Tutorials

 
 

PHP Functions, PHP Functions Tutorials
Posted on: February 16, 2005 at 12:00 AM
Advertisement
Learn PHP Functions with examples.

PHP Functions

In this section we will understand important PHP functions with the help of example code.

What is Functions?

Function is a block of code to do some processing. The function contains the logic to do an unit of work. For example you can create function to check if an user is valid or not by passing  username and password as parameter. In the function declaration you may have to write code to connect to database and validate user.

Here is an example of custom function:

function validateUser($username,$password) {
                $isValidUser=false;
		//Write code to connect to database and then validate user
		//if user found set the value of variable $isValidUser to true
		//finally return the $isValidUser value
                return $isValidUser;
}

Functions in PHP

PHP provides many built-in functions to do the real job. There are around 5000 functions available in PHP. These functions provides a lot functionalities. It helps the developers to do complex programming easily and rapidly.

Here are the list of important PHP functions with explanation and example code:

PHP Date and Time

PHP Date add days

PHP Date add 1 day

Check Date in PHP

PHP date add function

PHP date_create

PHP date_create_from_format function

The PHP Date() Function

PHP Date and Time

Eval () PHP Function, Example of Eval () PHP Function
Learn how to use Eval () PHP Function to execute PHP code.
 
Advertisement

Related Tags for PHP Functions, PHP Functions Tutorials:


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: February 16, 2005

Recommend the tutorial

Advertisements Advertisements
 

 

 

DMCA.com