+add a note
User Contributed Notes 1 note
cmnajs at gmail dot com ¶
15 years ago
Following code returns the curl output as a string.
<?php
// create curl resource
$ch = curl_init();
// set url
curl_setopt($ch, CURLOPT_URL, "example.com");
//return the transfer as a string
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// $output contains the output string
$output = curl_exec($ch);
// close curl resource to free up system resources
curl_close($ch);
?>
↑ and ↓ to navigate •
Enter to select •
Esc to close
Press Enter without
selection to search using Google