我用下面的代碼
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