HN2new | past | comments | ask | show | jobs | submitlogin

PHP function to perform a basic cURL request and return the result. Got a little bit tired of writing "curl_setopt(...".


Typically this is what file_get_contents() is for (with fopen_wrappers enabled) if you just want a simple GET.


In newer versions of PHP, you can use `stream_context_create` to make post requests and more, using `file_get_contents`




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: