Created
October 6, 2015 15:32
-
-
Save showsky/204a93a43a55a7dfc883 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function fetch_image($url, $referer) | |
| { | |
| $curl = curl_init($url); | |
| curl_setopt($curl, CURLOPT_HEADER, FALSE); | |
| curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE); | |
| curl_setopt($curl, CURLOPT_REFERER, $referer); | |
| $re = curl_exec($curl); | |
| if (curl_errno($curl)) | |
| { | |
| return NULL; | |
| } | |
| return $re; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment