Here is a sample script to use curl and check the output. You can use this script in your local server and if curl is installed then you will get simple output message from this website.
<?Php
$my_curl = curl_init();
$str="John"; // Change to your name
curl_setopt($my_curl, CURLOPT_URL, "https://www.plus2net.com/php_tutorial/curl-test.php?str=$str");
curl_setopt($my_curl, CURLOPT_RETURNTRANSFER, 1);
$return_str = curl_exec($my_curl);
curl_close($my_curl);
echo $return_str;
?>
Opening a URL by file_get_contents()
← Subscribe to our YouTube Channel here