我用下面的代码
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
}
〜感谢
以下任何地方几乎相同,我刚才的问题check if allow_url_fopen is enabled or not
为什么不使用'function_exists( 'curl_version')'因为你'_iscurl()'函数? –
参见编写['function'](http://php.net/function)的手册,把你的一行内容放到那里,用'return'替换'echo'并剪下三元组。 – mario