Loading…

What is the use of cURL()?

It is a PHP library and a command line tool that helps us to send files and also download data over HTTP and FTP. It also supports proxies, and you can transfer data over SSL connections.

Example

                                        

Using cURL function module to fetch the abc.in homepage

$ch = curl_init("https://www.bestinterviewquestion.com/");
$fp = fopen("index.php", "w");
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);

Suggest An Answer

No suggestions avaliable!

Latest post from PHP interview questions

Ask Question