cURL is a great command-line tool for making network requests. It specially becomes handy while making HTTP requests from command line for troubleshooting / monitoring purposes. libcurl is considered to be high-level tool that have bindings for many high-level languages which make it easy for developers to use cURL features from programming language of their […]
You can save the cURL output as a string for further manipulation.
Following code takes care of:
// create curl resource $ch = curl_init(); // set url curl_setopt($ch, CURLOPT_URL, “http://example.com”); // return the transfer as a string curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // save output to string $output = curl_exec($ch); // close curl resource to free up […]