Skip to content

Instantly share code, notes, and snippets.

View scoinhawk's full-sized avatar

scoinhawk scoinhawk

View GitHub Profile
@scoinhawk
scoinhawk / gist:56b3ec36abf0ad41816989f17ac8a21e
Created August 30, 2021 15:05 — forked from maxcal/gist:2947417
Simple Curl web scraper
<?php
/**
* @param string $url - the url you wish to fetch.
* @return string - the raw html respose.
*/
function web_scrape($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$response = curl_exec($ch);