Heres the curl docs: http://php.net/curl_init
I could give you the code solution but then you would learn nothing.