grabbing content from URL via CURL to PHP variable


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. $ch = curl_init();
  2.  
  3. curl_setopt($ch, CURLOPT_URL,"http://www.google.com");
  4. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  5. $contents = curl_exec ($ch);
  6. curl_close ($ch);

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.