<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.funchand.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'function.function-exists.php',
    1 => 'function_exists',
    2 => 'Indique si une fonction est d&eacute;finie',
  ),
  'up' => 
  array (
    0 => 'ref.funchand.php',
    1 => 'Fonctions sur la gestion des fonctions',
  ),
  'prev' => 
  array (
    0 => 'function.func-num-args.php',
    1 => 'func_num_args',
  ),
  'next' => 
  array (
    0 => 'function.get-defined-functions.php',
    1 => 'get_defined_functions',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/funchand/functions/function-exists.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.function-exists" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">function_exists</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">function_exists</span> &mdash; <span class="dc-title">Indique si une fonction est définie</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.function-exists-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>function_exists</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$function</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Vérifie la liste des fonctions définies par l&#039;utilisateur ainsi que celles
   internes à php afin d&#039;y trouver <code class="parameter">function</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.function-exists-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">function</code></dt>
     <dd>
      <p class="para">
       Le nom de la fonction, sous la forme d&#039;une <a href="language.types.string.php" class="link">chaîne de caractères</a>.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.function-exists-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> si la fonction <code class="parameter">function</code>
   existe et est une fonction, <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> sinon.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Il est à noter également que <span class="function"><strong>function_exists()</strong></span> retournera
    <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> pour les instructions comme
    <span class="function"><a href="function.include-once.php" class="function">include_once</a></span> et
    <span class="function"><a href="function.echo.php" class="function">echo</a></span>.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 examples" id="refsect1-function.function-exists-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Exemple avec <span class="function"><strong>function_exists()</strong></span></strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">function_exists</span><span style="color: #007700">(</span><span style="color: #DD0000">'imap_open'</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">"Les fonctions IMAP sont disponibles.&lt;br /&gt;\n"</span><span style="color: #007700">;<br />} else {<br />    echo </span><span style="color: #DD0000">"Les fonctions IMAP ne sont pas disponibles.&lt;br /&gt;\n"</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.function-exists-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="para">
    Un nom de fonction peut exister même si la fonction elle-même n&#039;est pas
    utilisable à cause d&#039;une configuration ou d&#039;une option de compilation
    (avec les fonctions <a href="ref.image.php" class="link">image</a> par exemple).
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.function-exists-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.method-exists.php" class="function" rel="rdfs-seeAlso">method_exists()</a> - V&eacute;rifie si la m&eacute;thode existe pour une classe</span></li>
    <li><span class="function"><a href="function.is-callable.php" class="function" rel="rdfs-seeAlso">is_callable()</a> - D&eacute;termine si une valeur peut &ecirc;tre appel&eacute; comme une fonction
   dans la port&eacute;e courante</span></li>
    <li><span class="function"><a href="function.get-defined-functions.php" class="function" rel="rdfs-seeAlso">get_defined_functions()</a> - Liste toutes les fonctions d&eacute;finies</span></li>
    <li><span class="function"><a href="function.class-exists.php" class="function" rel="rdfs-seeAlso">class_exists()</a> - V&eacute;rifie si une classe a &eacute;t&eacute; d&eacute;finie</span></li>
    <li><span class="function"><a href="function.extension-loaded.php" class="function" rel="rdfs-seeAlso">extension_loaded()</a> - D&eacute;termine si une extension est charg&eacute;e ou non</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>