最佳答案
可能的复制品:
在 php 中写一个函数
我使用以下代码
echo 'Curl: ', function_exists('curl_version') ? 'Enabled' : 'Disabled';
这可以让它启用或禁用
但是我想把函数名称写成 _iscurl
然后我可以调用它作为以下任何地方在我的网站代码
if (_iscurl()){
echo "this is enabled"; // will do an action
}else{
echo "this is disabled"; // will do another action
}
几乎和我之前的问题 检查 allow _ url _ fopen 是否启用一样