Curl Example in PHP

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.
$my_curl = curl_init(); 
$str="John";  // Change to your name
curl_setopt($my_curl, CURLOPT_URL, "$str"); 
curl_setopt($my_curl, CURLOPT_RETURNTRANSFER, 1); 
$return_str = curl_exec($my_curl); 
echo $return_str;

Opening a URL by file_get_contents()

Subscribe to our YouTube Channel here


* indicates required
Subscribe to plus2net

    Post your comments , suggestion , error , requirements etc here .

    We use cookies to improve your browsing experience. . Learn more
    HTML MySQL PHP JavaScript ASP Photoshop Articles FORUM . Contact us
    ©2000-2022 All rights reserved worldwide Privacy Policy Disclaimer