Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function curl_and_load($url, $lowercase=true, $curlopts=false){
- $ch = curl_init($url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- $useragent="Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322)";
- curl_setopt($ch, CURLOPT_USERAGENT, $useragent);
- if($curlopts)
- {
- foreach($curlopts as $o => $s)
- {
- curl_setopt($ch, $o, $s);
- }
- }
- $curl_scraped_page = curl_exec($ch);
- curl_close($ch);
- $this->load($curl_scraped_page,$lowercase);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement