Verify if PDO extension is installed


/ Published in: PHP
Save to your folder(s)

Code to verify is PDO extension is installed.


Copy this code and paste it in your HTML
  1. <?php
  2. if (!defined('PDO::ATTR_DRIVER_NAME'))
  3. {
  4. echo 'PDO unavailable';
  5. }
  6. elseif (defined('PDO::ATTR_DRIVER_NAME'))
  7. {
  8. echo 'PDO available';
  9. }
  10. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.