<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>Internal (built-in) functions</title> </head> <body><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="functions.variable-functions.html">Variable functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="functions.anonymous.html">Anonymous functions</a></div> <div class="up"><a href="language.functions.html">Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div><hr /><div id="functions.internal" class="sect1"> <h2 class="title">Internal (built-in) functions</h2> <p class="para"> PHP comes standard with many functions and constructs. There are also functions that require specific PHP extensions compiled in, otherwise fatal "undefined function" errors will appear. For example, to use <a href="ref.image.html" class="link">image</a> functions such as <span class="function"><a href="function.imagecreatetruecolor.html" class="function">imagecreatetruecolor()</a></span>, PHP must be compiled with <span class="productname">GD</span> support. Or, to use <span class="function"><a href="function.mysql-connect.html" class="function">mysql_connect()</a></span>, PHP must be compiled with <a href="ref.mysql.html" class="link">MySQL</a> support. There are many core functions that are included in every version of PHP, such as the <a href="ref.strings.html" class="link">string</a> and <a href="ref.var.html" class="link">variable</a> functions. A call to <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span> or <span class="function"><a href="function.get-loaded-extensions.html" class="function">get_loaded_extensions()</a></span> will show which extensions are loaded into PHP. Also note that many extensions are enabled by default and that the PHP manual is split up by extension. See the <a href="configuration.html" class="link">configuration</a>, <a href="install.html" class="link">installation</a>, and individual extension chapters, for information on how to set up PHP. </p> <p class="para"> Reading and understanding a function's prototype is explained within the manual section titled <a href="about.prototypes.html" class="link">how to read a function definition</a>. It's important to realize what a function returns or if a function works directly on a passed in value. For example, <span class="function"><a href="function.str-replace.html" class="function">str_replace()</a></span> will return the modified string while <span class="function"><a href="function.usort.html" class="function">usort()</a></span> works on the actual passed in variable itself. Each manual page also has specific information for each function like information on function parameters, behavior changes, return values for both success and failure, and availability information. Knowing these important (yet often subtle) differences is crucial for writing correct PHP code. </p> <blockquote class="note"><p><strong class="note">Note</strong>: <span class="simpara"> If the parameters given to a function are not what it expects, such as passing an <span class="type"><a href="language.types.array.html" class="type array">array</a></span> where a <span class="type"><a href="language.types.string.html" class="type string">string</a></span> is expected, the return value of the function is undefined. In this case it will likely return <strong><code>NULL</code></strong> but this is just a convention, and cannot be relied upon. </span> </p></blockquote> <p class="para"> See also <span class="function"><a href="function.function-exists.html" class="function">function_exists()</a></span>, <a href="funcref.html" class="link">the function reference</a>, <span class="function"><a href="function.get-extension-funcs.html" class="function">get_extension_funcs()</a></span>, and <span class="function"><a href="function.dl.html" class="function">dl()</a></span>. </p> </div><hr /><div class="manualnavbar" style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="functions.variable-functions.html">Variable functions</a></div> <div class="next" style="text-align: right; float: right;"><a href="functions.anonymous.html">Anonymous functions</a></div> <div class="up"><a href="language.functions.html">Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div> </div></body></html>