Jack Ben Jack Ben - 6 months ago 29
PHP Question

how to check if curl is enabled or disabled

Possible Duplicate:

Writing a function in php

I'm using the following code

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

this can get it enabled or disabled

but i would like to make as function say function name is

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

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

~ thanks

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


Just return your existing check from a function.

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