Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
fuzzmeister
· 15y ago · 0 comments
PHP function to perform a basic cURL request and return the result. Got a little bit tired of writing "curl_setopt(...".
Comments
[–]
dmpatierno
15y ago
Typically this is what file_get_contents() is for (with fopen_wrappers enabled) if you just want a simple GET.
[–]
troels
15y ago
In newer versions of PHP, you can use `stream_context_create` to make post requests and more, using `file_get_contents`