Web source code with CURL





1
Date Submitted Wed. Feb. 28th, 2007 1:38 AM
Revision 1 of 1
Beginner lalamen
Tags CURL | source | Web
Comments 0 comments
How to take web source code with CURL

<?php

// $page_url = Page URL

function page_source($page_url)
{
        $curl = curl_init();
        curl_setopt($curl,CURLOPT_URL,$page_url);
        curl_setopt($curl,CURLOPT_RETURNTRANSFER,1);
        $data = curl_exec($curl);
        curl_close($curl);
        return $data;
}

echo page_source('http://yahoo.com');

?>
 

Maor No

Comments

There are currently no comments for this snippet.

Voting

Votes Up


Scripter Sonsam

Votes Down