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 _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
}
almost same as my previous question check if allow_url_fopen is enabled or not
Cœur
35.5k24 gold badges188 silver badges257 bronze badges
asked Nov 17, 2012 at 19:21
Reham FahmyReham Fahmy
4,80315 gold badges49 silver badges70 bronze badges
2
Just return your existing check from a function.
function _isCurl[]{
return function_exists['curl_version'];
}
answered Nov 17, 2012 at 19:23
1
or a simple one -
Just search for curl
source - //www.mattsbits.co.uk/item-164.html
da5id
9,0308 gold badges38 silver badges53 bronze badges
answered Nov 17, 2012 at 19:28
Amit PandeyAmit Pandey
1,3661 gold badge22 silver badges34 bronze badges
var_dump[extension_loaded['curl']];
mpen
261k259 gold badges814 silver badges1187 bronze badges
answered May 4, 2014 at 13:01
Alex SAlex S
6896 silver badges8 bronze badges
3
Hope this helps.
answered Nov 17, 2012 at 19:25
2
you can check by putting these code in php file.