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()

Visitors Rating
Your Rating


Post Comment This is for short comments only. Use the forum for more discussions.

HTML . MySQL. PHP. JavaScript. ASP. Photoshop. Articles. FORUM Contact us
©2000-2018 All rights reserved worldwide Privacy Policy Disclaimer