Duncan <[EMAIL PROTECTED]> wrote: > i wrote a script, which uses the IMAP-extension. But if s.o. uses it > on a machine, which doesn't support IMAP functions, i get an error > message. How can i prevent this error: > > Fatal error: Call to undefined function: imap_open() in > /home/test/public_html/test/imap_test.php on line 8 > > and replace it with s.th. like: "This function doesn't work, due to > missing IMAP extension". > > I already tried some stuff, but the problem is, that php exits the > script as soon as it hits the first IMAP related function.
http://www.php.net/manual/en/function.extension-loaded.php if (!extension_loaded("imap")) { die("the imap extension is not loaded."); } jim -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php