Jump to content

Simple curl tutorial?


snowman15

Recommended Posts

If you just want the source of a page, you can use any of the file functions, like file_get_contents()

 

but to do it with cURL:

<?php
  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
  curl_setopt($ch, CURLOPT_HEADER, 0);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  $source = curl_exec($ch);
  curl_close($ch);
?>

Link to comment
https://forums.phpfreaks.com/topic/104591-simple-curl-tutorial/#findComment-535378
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.