Php checks whether the function function_exists exists.

Source: Internet
Author: User
Tags imap

Syntax
Bool function_exists (string $ function_name)
Check the list of defined functions. Both built-in and user-defined functions are function_name.
Return value

Returns true. If function_name exists, it is a function. Otherwise, false is returned.
*/

If (function_exists ('imap _ open ')){
Echo "imap functions are available.www.111cn.net <br/> ";
} Else {
Echo "imap functions are not available. <br/> ";
}


// Function_exists returns false on null and empty string:

If (function_exists ('')){
Echo "empty string function exists ";
        }

If (function_exists (null )){
Echo "null function exists ";
        }
  
// If you use suhosin.exe cutor. func. blacklist instead of in your php. ini disabled_functions, function_exists returns true as the function. This is the same as suhosin.exe cutor. func. blacklist and disabled_functions beahviur:

Function suhosin_function_exists ($ func ){
If (extension_loaded ('suhosin ')){
$ Suhosin = @ ini_get ("suhosin.exe cutor. func. blacklist ");
If (empty ($ suhosin) = false ){
$ Suhosin = explode (',', $ suhosin );
$ Suhosin = array_map ('trim', $ suhosin );
$ Suhosin = array_map ('strtolower ', $ suhosin );
Return (function_exists ($ func) = true & array_search ($ func, $ suhosin) = false );
        }
    }
Return function_exists ($ func );
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.