Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $libcurl = FFI::cdef(
- <<< CDEF
- void *curl_easy_init();
- int curl_easy_setopt(void *curl, int Options, ...);
- int curl_easy_perform(void *curl);
- void curl_easy_cleanup(void *handle);
- CDEF,
- 'libcurl.so'
- );
- $url = 'https://nasa.gov';
- $ch = $libcurl->curl_easy_init();
- $libcurl->curl_easy_setopt($ch, CURLOPT_URL, $url);
- $libcurl->curl_easy_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
- $libcurl->curl_easy_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
- $libcurl->curl_easy_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
- $result = $libcurl->curl_easy_perform($ch);
- $libcurl->curl_easy_cleanup($ch);
- var_dump($result);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement