php判断是否为命令行模式

function is_cli(){
    return preg_match("/cli/i", php_sapi_name()) ? 1 : 0;
}

猜你喜欢

转载自www.cnblogs.com/waw/p/10167245.html