Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 2802

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!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>Find out whether an extension is loaded</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.dl.html">dl</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.gc-collect-cycles.html">gc_collect_cycles</a></div>
 <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.extension-loaded" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">extension_loaded</h1>
  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">extension_loaded</span> &mdash; <span class="dc-title">Find out whether an extension is loaded</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.extension-loaded-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>extension_loaded</strong></span>
    ( <span class="methodparam"><span class="type">string</span> <code class="parameter">$name</code></span>
   )</div>

  <p class="para rdfs-comment">
   Finds out whether the extension is loaded.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.extension-loaded-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">name</code></em></span>
     <dd>

      <p class="para">
       The extension name.
      </p>
      <p class="para">
       You can see the names of various extensions by using
        <span class="function"><a href="function.phpinfo.html" class="function">phpinfo()</a></span> or if you&#039;re using the
       <em>CGI</em> or <em>CLI</em> version of
       PHP you can use the <strong class="option unknown">-m</strong>
 switch to
       list all available extensions:
       <div class="example-contents screen">
<div class="cdata"><pre>
$ php -m
[PHP Modules]
xml
tokenizer
standard
sockets
session
posix
pcre
overload
mysql
mbstring
ctype

[Zend Modules]
</pre></div>
       </div>
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.extension-loaded-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> if the extension identified by <em><code class="parameter">name</code></em>
   is loaded, <strong><code>FALSE</code></strong> otherwise.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.extension-loaded-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-483">
   <p><strong>Example #1  <span class="function"><strong>extension_loaded()</strong></span> example</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&nbsp;(!</span><span style="color: #0000BB">extension_loaded</span><span style="color: #007700">(</span><span style="color: #DD0000">'gd'</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(!</span><span style="color: #0000BB">dl</span><span style="color: #007700">(</span><span style="color: #DD0000">'gd.so'</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit;<br />&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

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


 <div class="refsect1 changelog" id="refsect1-function.extension-loaded-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.0.0</td>
       <td>
         <span class="function"><strong>extension_loaded()</strong></span> uses the internal extension name
        to test whether a certain extension is available or not. Most internal
        extension names are written in lower case but there may be extensions
        available which also use uppercase letters. Prior to PHP 5, this function
        compared the names case sensitively.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.extension-loaded-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.get-loaded-extensions.html" class="function" rel="rdfs-seeAlso">get_loaded_extensions()</a> - Returns an array with the names of all modules compiled and loaded</span></li>
    <li class="member"> <span class="function"><a href="function.get-extension-funcs.html" class="function" rel="rdfs-seeAlso">get_extension_funcs()</a> - Returns an array with the names of the functions of a module</span></li>
    <li class="member"> <span class="function"><a href="function.phpinfo.html" class="function" rel="rdfs-seeAlso">phpinfo()</a> - Outputs information about PHP's configuration</span></li>
    <li class="member"> <span class="function"><a href="function.dl.html" class="function" rel="rdfs-seeAlso">dl()</a> - Loads a PHP extension at runtime</span></li>
    <li class="member"> <span class="function"><a href="function.function-exists.html" class="function" rel="rdfs-seeAlso">function_exists()</a> - Return TRUE if the given function has been defined</span></li>
   </ul>
  </p>
 </div>


</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.dl.html">dl</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.gc-collect-cycles.html">gc_collect_cycles</a></div>
 <div class="up"><a href="ref.info.html">PHP Options/Info Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>