ob_start( );
phpinfo( );
$phpinfo = ob_get_contents( );
ob_end_clean( );
if (strpos($phpinfo, "module_pdf") === FALSE) {
echo "You do not have PDF support in your PHP, sorry.";
} else {
echo "Congratulations, you have PDF support!";
}
Of course, a quicker and simpler approach to check if a certain
extension is available is to pick a function that you know the
extension provides and check if it exists. For the PDF extension, you
might do:
if (function_exists('pdf_begin_page'))