如何检查是否启用了卷曲 [英] How to check if curl is enabled or disabled

查看:99
本文介绍了如何检查是否启用了卷曲的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
在php中编写函数

Possible Duplicate:
Writing a function in php

我正在使用以下代码

echo 'Curl: ', function_exists('curl_version') ? 'Enabled' : 'Disabled';

这可以启用或禁用它

但是我想让函数说函数名是_iscurl

but I would like to make as function say function name is _iscurl

然后我可以在网站代码中的任意位置调用它

then I can call it as following any where in my website code

if (_iscurl()){
  echo "this is enabled"; // will do an action
}else{
  echo "this is disabled"; // will do another action
}

与我之前的问题几乎相同检查是否启用allow_url_fopen

almost same as my previous question check if allow_url_fopen is enabled or not

推荐答案

只需从 function .

function _isCurl(){
    return function_exists('curl_version');
}

这篇关于如何检查是否启用了卷曲的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆