answersLogoWhite

0

What are php functions?

User Avatar

Anonymous

14y ago
Updated: 8/19/2019

A function is a set of commands. These commands usually call other, more basic functions and called one after the other they work together to archive a certain objective, sometimes simple, sometimes complex.

Say the purpose of the function is to erase all hyphen (-) and at (@) characters in some text. The function will is accept a parameter (the text) and return a value (the formatted text). Here's how that would look in the code...

function strip_slashes ($text) {

return str_replace(".", "", str_replace("@", "", $text));

}

This code creates a function called "strip_slashes", the function accepts the "$text" parameter and then runs the built in PHP function "str_replace" twice to replace the @ and - characters with nothing (effectively erasing them). In the same line we tell our function to "return" the results of our two "str_replace" functions.

PHP has over 700 built in functions able to do just about anything you can think of. If it's not there, likely because it's very specific to your application, then you can simple write it yourself.

User Avatar

Wiki User

14y ago

What else can I help you with?

Related Questions

What are the functions of PHP?

http://www.php.net/quickref.php


How many in-built functions in PHP?

There are thousands.


How are PHP and MySQL compatible?

By sending messages to the MySQL server, you can communicate with the database. To submit SQL queries to the database, you use PHP functions. You don't need to know how to communicate with MySQL because PHP takes care of that. You only need to be familiar with SQL queries and PHP functions. To learn more about data science please visit- Learnbay.co


What are all the built-in PHP functions?

See the related links for a shortcut to the entire reference of every function in PHP. The default built-in functions differ from the categories of extensions you choose to install, and the version of PHP you're installing - therefore, it's impossible to give a stable list of built-in functions.


What are the advantages and disadvantages of the PHP functions include and require and any functions that branch off of them?

something


Where could one find a manual for the PHP mail functions?

One can find a manual for the PHP mail functions on the PHP Mail website. One can read it online or print it out to read as a hard copy. The manual is also available on the 'NuSphere' website.


Are all the PHP 6 functions and codes supported by WAMP 2.0i?

PHP 6 hasn't been released yet.


What are semantics in PHP?

PHP is related with HTML. HTML can be included into PHP script as well as PHP script can be included into HTML code. PHP begins and ends with <?php ?>. PHP is mix of few languages so semantics is mixed too.


What is PHP data coding?

PHP data coding is softwares that allows or has frameworks which can make PHP input to it's own script language. So you may code programs for example with PHP, just that it has to be extended PHP because of new functions and features. It may also be application coding for the web.


What is framework in php?

A framework in PHP is a set of prebuilt classes and functions (like cakePHP.org or codeignitor) that let's you add basic classes and write less do more.


What PHP Codes?

if i got your question right, you mean "what are php tags?" your should write PHP codes between <?php ... ?> where ... should be replaced by codes that you need. But if you mean "what are php codes?": there are some default codes that you may find them on php.net, and the other part is codes (Functions or classes) that other programmers develops..


How do you use regular expressions in PHP?

Use the preg functions (ereg functions are deprecated) Wiki regex to form your regex string