downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/pdo.getavailabledrivers.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/class.pdo.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'pdo.getavailabledrivers.php',
   
1 => 'PDO::getAvailableDrivers',
  ),
 
'up' =>
  array (
   
0 => 'class.pdo.php',
   
1 => 'The PDO class',
  ),
 
'prev' =>
  array (
   
0 => 'pdo.getattribute.php',
   
1 => 'PDO::getAttribute',
  ),
 
'next' =>
  array (
   
0 => 'pdo.lastinsertid.php',
   
1 => 'PDO::lastInsertId',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="pdo.getavailabledrivers" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">PDO::getAvailableDrivers</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.3, PECL pdo &gt;= 1.0.3)</p><p class="refpurpose"><span class="refname">PDO::getAvailableDrivers</span> &mdash; <span class="dc-title">
   Return an array of available PDO drivers
  </span></p>

 </div>
 <a name="pdo.getavailabledrivers.description"></a><div class="refsect1 description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><b>PDO::getAvailableDrivers</b></span>
    ( <span class="methodparam">void</span>
   )</div>

  <div class="methodsynopsis dc-description">
   <span class="type">array</span> <span class="methodname"><b>pdo_drivers</b></span>
    ( <span class="methodparam">void</span>
   )</div>

  <p class="para rdfs-comment">
   This function returns all currently available PDO drivers which can be used
   in <i><tt class="parameter">DSN</tt></i>
 parameter of
   <a href="pdo.construct.php" class="function">PDO::__construct()</a>.  This is a static method.
  </p>

 </div>

 <a name="pdo.getavailabledrivers.returnvalues"></a><div class="refsect1 returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   <b>PDO::getAvailableDrivers()</b> returns an array of PDO driver names. If
   no drivers are available, it returns an empty array.
  </p>
 </div>


 <a name="pdo.getavailabledrivers.examples"></a><div class="refsect1 examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   </p><div class="example">
    <p><b>Example #1 A <b>PDO::getAvailableDrivers()</b> example</b></p>
    <div class="example-contents programlisting">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">PDO</span><span style="color: #007700">::</span><span style="color: #0000BB">getAvailableDrivers</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

    <div class="example-contents para"><p>The above example will output
something similar to:</p></div>
    <div class="example-contents screen">
<div class="cdata"><pre>
Array
(
    [0] =&gt; mysql
    [1] =&gt; sqlite
)
</pre></div>
    </div>
   </div><p>
  </p>
 </div>


</div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites