PHP Functions
In PHP a function is a predefined set of commands that are carried out when the function is called. In addition to being able to write your own functions, PHP has a number of predefine functions for you to use. Below are many functions we discuss in our various tutorials, with simple definitions and examples to follow.
Asin () PHP Function
How to find the arcsine (asin) of a number using PHP.
How to find the arcsine (asin) of a number using PHP.
Acos () PHP Function
How to use the acos function to return the arccosine of a number using PHP.
How to use the acos function to return the arccosine of a number using PHP.
Abs () PHP Function
How to use the ABS () function in PHP to return the absolute value of a number
How to use the ABS () function in PHP to return the absolute value of a number
Addslashes () PHP Function
Addslashes adds back slashes into your form data
Addslashes adds back slashes into your form data
Array () PHP Function
Array () PHP Function
Array () PHP Function
Base_convert () PHP Function
Converting one number base to another using PHP
Converting one number base to another using PHP
Cal_days_in_month () PHP Function
This PHP function tells you how many days are in a given month in a given year.
This PHP function tells you how many days are in a given month in a given year.
Ceil () PHP Function
Always rounding a number up to the nearest whole number
Always rounding a number up to the nearest whole number
Cos () PHP Function
How to calculate the cosine of a number, in radians, using PHP.
How to calculate the cosine of a number, in radians, using PHP.
Crypt () PHP Function
The crypt () function encrypts data in PHP
The crypt () function encrypts data in PHP
Date () PHP Function
Use date to format the time () function's output.
Use date to format the time () function's output.
Easter_date () PHP Function
PHP function that calculates what day Easter Sunday falls on in any given year.
PHP function that calculates what day Easter Sunday falls on in any given year.
Echo () PHP Function
Echo () PHP Function
Echo () PHP Function
Else () PHP Function
Else () is used to give an alternate set of code to execute when the if () part of a statement is false.
Else () is used to give an alternate set of code to execute when the if () part of a statement is false.
Elseif () PHP Function
Elseif () is used in conditional statements to make choices.
Elseif () is used in conditional statements to make choices.
Eval () PHP Function
Eval () is used to evaluate its input string as PHP code
Eval () is used to evaluate its input string as PHP code
Feof () PHP Function
The FEOF PHP function is used to test for the end of the file.
The FEOF PHP function is used to test for the end of the file.
Fgets () PHP Function
Fgets is a PHP function that gets data from an external file line by line.
Fgets is a PHP function that gets data from an external file line by line.
File () PHP Function
File () pulls data from an outside file and puts it into an array .
File () pulls data from an outside file and puts it into an array .
File_Get_Contents () PHP Function
File_get_contents reads the data from a file and returns it to the PHP file as a string
File_get_contents reads the data from a file and returns it to the PHP file as a string
Floor () PHP Function
Always rounding a number down to the nearest whole number
Always rounding a number down to the nearest whole number
Fopen () PHP Function
Use fopen() to open a file from php
Use fopen() to open a file from php
For () PHP Function
For () is a form of loop in PHP
For () is a form of loop in PHP
Foreach () PHP Function
Foreach () is a form of loop in PHP
Foreach () is a form of loop in PHP
Fread () PHP Function
Fread is a php function used to read the contents of a file and report the data back to the php file.
Fread is a php function used to read the contents of a file and report the data back to the php file.
Fwrite () PHP Function
fwrite is a binary safe file write used to write to a file in PHP
fwrite is a binary safe file write used to write to a file in PHP
Getenv () PHP Function
Free tutorial about how to use the getenv() command in PHP to get such things as the document root, or the user's IP address.
Free tutorial about how to use the getenv() command in PHP to get such things as the document root, or the user's IP address.
Get_magic_quotes_gpc () PHP Function
Checks if Magic Quotes is turned on or off in your php configuration
Checks if Magic Quotes is turned on or off in your php configuration
Htmlspecialchars () PHP Function
Htmlspecialchars is used to convert special characters to HTML entities
Htmlspecialchars is used to convert special characters to HTML entities
If () PHP Function
If () is used as a conditional statement in PHP
If () is used as a conditional statement in PHP
ImageColorAllocate () PHP Function
The ImageColorAllocate () function is used in PHP to set the color for an image you are creating.
The ImageColorAllocate () function is used in PHP to set the color for an image you are creating.
Imagecreate () PHP Function
The imagecreate () function is used in PHP to create a new palette based image
The imagecreate () function is used in PHP to create a new palette based image
Imagecreatetruecolor () PHP Function
The imagecreatetruecolor () function is used in PHP to create a new true color image
The imagecreatetruecolor () function is used in PHP to create a new true color image
Imageellipse () PHP Function
Used to draw an ellipse in PHP using the GD Library
Used to draw an ellipse in PHP using the GD Library
Imagefilledarc () PHP Function
Used to draw arcs or pie graphs in PHP using the GD Library
Used to draw arcs or pie graphs in PHP using the GD Library
ImageLine () PHP Function
Used to draw a line in PHP using the GD Library
Used to draw a line in PHP using the GD Library
Imagepolygon () PHP Function
How to draw a polygon in PHP using the imagepolygon function and assigning the coordinates of each corner
How to draw a polygon in PHP using the imagepolygon function and assigning the coordinates of each corner
Imagerotate () PHP Function
How to rotate an image using PHP with the GD Library
How to rotate an image using PHP with the GD Library
Imagestring () PHP Function
Image String is used to add a string (text) to an image
Image String is used to add a string (text) to an image
Include () PHP Function
Include external files within a PHP file
Include external files within a PHP file
Is_Binary () PHP Function
This Is_Binary function in PHP is used to check if the input is a binary number.
This Is_Binary function in PHP is used to check if the input is a binary number.
Is_Numeric () PHP Function
The PHP function is_numeric is used to check if a variable is a number.
The PHP function is_numeric is used to check if a variable is a number.
Is_string () PHP Function
The is_string php function is used to check if the value is a string. It will return true or false.
The is_string php function is used to check if the value is a string. It will return true or false.
Mail () PHP Function
Sending email from PHP with mail ()
Sending email from PHP with mail ()
Max () PHP Function
The Max () php function returns the largest number in an array or group of numbers
The Max () php function returns the largest number in an array or group of numbers
Min () PHP Function
The Min () php function returns the lowest number in an array or group of numbers
The Min () php function returns the lowest number in an array or group of numbers
Mktime () PHP Function
Mktime is used to get the timestamp for a specific date
Mktime is used to get the timestamp for a specific date
Mysql_close () PHP Function
How to close a MySQL Connection from a PHP file
How to close a MySQL Connection from a PHP file
Mysql_connect() PHP Function
How to connect to your MySQL database from a PHP document
How to connect to your MySQL database from a PHP document
Mysql_error () PHP Function
Report an error into PHP from MySQL when your SQL code encounters problems
Report an error into PHP from MySQL when your SQL code encounters problems
Number_format () PHP Function
Format the decimal and 1000 separators, as well as the number of decimals places in a number
Format the decimal and 1000 separators, as well as the number of decimals places in a number
PHPinfo () PHP Function
Learn more about the version of PHP your server is running using the php info command to see your version, path, and specific settings.
Learn more about the version of PHP your server is running using the php info command to see your version, path, and specific settings.
Pi () PHP Function
How to use the PI () PHP function as well as M_PI, M_PI_2, M_PI_4, M_1_PI, M_2_PI, M_SQRTPI, M_2_SQRTPI in your PHP code
How to use the PI () PHP function as well as M_PI, M_PI_2, M_PI_4, M_1_PI, M_2_PI, M_SQRTPI, M_2_SQRTPI in your PHP code
Pow () PHP Function
How to use exponents in PHP to raise a number to the power of another number.
How to use exponents in PHP to raise a number to the power of another number.
Preg_grep () PHP Function
Using Preg_grep to search an array and return an array
Using Preg_grep to search an array and return an array
Preg_match () PHP Function
Searching a string and returning a true or false with preg_match
Searching a string and returning a true or false with preg_match
Preg_match_all () PHP Function
Searching an entire string for specified terms, and outputting to an array
Searching an entire string for specified terms, and outputting to an array
Preg_replace () PHP Function
Performing a find and replace on a string or an array.
Performing a find and replace on a string or an array.
Preg_split () PHP Function
Splitting a string into an array based on your specifications
Splitting a string into an array based on your specifications
Print () PHP Function
Print () PHP Function
Print () PHP Function
Print_r () PHP Function
Print_R is used to return an array in a human readable form in PHP
Print_R is used to return an array in a human readable form in PHP
Rand () PHP Function
Generating a random number in PHP with the rand () function
Generating a random number in PHP with the rand () function
Require () PHP Function
Include external files within a PHP file
Include external files within a PHP file
Round () PHP Function
Rounding a number to a specified amount of decimals
Rounding a number to a specified amount of decimals
<Script> Tags
How to use PHP in a file that supports mixed scripting languages using the <script> tags
How to use PHP in a file that supports mixed scripting languages using the <script> tags
Session_destroy () PHP Function
Session_destroy () is used to destroy all the data in a current session
Session_destroy () is used to destroy all the data in a current session
Session_set_cookie_params () PHP Function
Session_set_cookie_params () is used to set the duration of a session cookie, as well as other optional cookie information
Session_set_cookie_params () is used to set the duration of a session cookie, as well as other optional cookie information
Session_start() PHP Function
The session_start() function is used at the beginning of all PHP pages utilizing sessions.
The session_start() function is used at the beginning of all PHP pages utilizing sessions.
Session_unset () PHP Function
Session_unset() is used to clear all the variables in a session
Session_unset() is used to clear all the variables in a session
Setcookie () PHP Function
A cookie is used to store information about a user on their computer
A cookie is used to store information about a user on their computer
Sin () PHP Function
How to use the sine (sin) function to do mathematics in PHP
How to use the sine (sin) function to do mathematics in PHP
Sqrt () PHP Function
Sqrt () PHP Function
Sqrt () PHP Function
Stripslashes () PHP Function
Stripslashes is used to remove blackslashes from data in php
Stripslashes is used to remove blackslashes from data in php
Str_replace () PHP Function
Str_replace is used to find and replace parts of a string in PHP
Str_replace is used to find and replace parts of a string in PHP
Switch () PHP Function
The PHP switch () function is used in replace of multiple if or elseif statements.
The PHP switch () function is used in replace of multiple if or elseif statements.
Tan () PHP Function
How to use the tangent (tan) function to do mathematics in PHP
How to use the tangent (tan) function to do mathematics in PHP
Time () PHP Function
Accessing the server time and formatting it
Accessing the server time and formatting it
Uniqid () PHP Function
PHP code to generate a random unique user ID
PHP code to generate a random unique user ID
Unset () PHP Function
Unset is used to destroy specified variables in PHP
Unset is used to destroy specified variables in PHP
While () PHP Function
While () is a form of loop in PHP
While () is a form of loop in PHP
All PHP Functions
Learn all available PHP functions and what use each of them does in PHP.
Learn all available PHP functions and what use each of them does in PHP.
