WordPress Code Snippets

A fresh mix of code snippets and tutorials

Check for PHP cURL


Quick snippet for checking whether or not PHP’s cURL is available on the server.

First check to see whether or not curl is found in the array of loaded extensions:

Then you can use the $has_curl as a condition for any cURL-specific functionality. For example:

This logic helps to eliminate errors and keep things running smooth. Always a plus.

Update (2015/09/06): this also should work to test for cURL:

Way more simple and should be just as effective :)

Show Support

Like our new Facebook Page to show support!