且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

php is_function()确定变量是否为函数

更新时间:2023-11-28 19:00:04

使用 is_callable 确定给定变量是否为函数.例如:

Use is_callable to determine whether a given variable is a function. For example:

$func = function()
{  
    echo 'asdf';  
};

if( is_callable( $func ) )
{
    // Will be true.
}