Return to Snippet

Revision: 71008
at November 22, 2016 23:59 by Davis34

Initial Code

function get_data($url) {
	$ch = curl_init();
	$timeout = 5;
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
	curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
	curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
	$data = curl_exec($ch);
	return $data;

$returned_content = get_data(''); // Curl a bitcoin forum
echo $returned_content;


Initial URL

Initial Description
This example will CURL a forum and echo it's contents using SSL support.

Initial Title
Get A Website Using Curl (SSL Support)

Initial Tags

Initial Language