How to Check CURL is available using PHP

How to Check CURL is available using PHP

You can check if curl is present in a web server, just use the below snipped to check if curl available. Below code will check if curl is available on the server.

<?php
function iscurlinstalled()
{
	if  (in_array  ('curl', get_loaded_extensions())) {
		return true;
	}
	else{
		return false;
	}
}
?>

Usage:

<?php
echo (iscurlinstalled())?'curl found':'no curl found';
?>