PHP Functions
PHP Functions Tutorial to learn PHP Functions online for free.
PHP functions are used to perform certain tasks. There are many built-in PHP functions that are used in web applications frequently. We will cover those most popular PHP functions with examples here.
PHP explode() Function
PHP explode() breaks a string into pieces and returns them as an array. You tell the function where to cut the string by giving a separator (also called delimiter), like a comma…
PHP strpos() Function
PHP strpos() finds the position of the first occurrence of a text inside another string. It returns the position as a number (starting from 0), or false if the text is not…
PHP implode() Function
PHP implode() joins all the elements of an array into one string. It is a built-in function. You give it a separator (also called glue) and an array, and it returns a…
PHP isset() Function
PHP isset() checks if a variable is set and its value is not NULL. It returns true or false. It is one of the most used functions in PHP, specially when you…
PHP empty() Function
PHP empty() checks whether a variable is empty. It returns true when the variable does not exist, or when it has a “false-like” value such as 0, empty string or NULL. It…
PHP is_null() Function
PHP is_null() checks whether a variable is NULL. It returns true only when the value is exactly NULL. NULL is a special value in PHP that means “no value”. A variable becomes…
PHP exit() Function
PHP exit() stops the current script immediately. It can also print a message before stopping. You can use exit() when something goes wrong and there is no point to run the remaining…
PHP header() Function
PHP header() sends a raw HTTP header to the browser. Headers are small instructions that go before the actual page content. Using header() you can redirect a user to another page, change…
PHP mail() Function
PHP mail() sends an email directly from your PHP script. You can use it for contact forms, welcome emails, password reset links and similar things. The mail() function does not send the…