PHP curl example

1. Initialize the curl by curl_init()
2. set the options by curl_setopt
3. curl_exec to get the result
4. Do whatever you like with the result. As an example, this code snippet decode the the json object and var dump it.

$url = "";
//  Initiate curl
$ch = curl_init();
// Disable SSL verification
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
// Will return the response, if false it print the response
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Set the url
curl_setopt($ch, CURLOPT_URL,$url);
// Execute
$results=json_decode($results, true);



Search within Codexpedia

Custom Search

Search the entire web

Custom Search