Can someone write a PHP script that reproduces the functionality of this linux shell command?
curl -X POST -u \"USERNAME:PASS\" \\
-H \"Content-Type: ap
A general rule: use the "--libcurl example.c" option to get curl to generate source code for a C program that would use libcurl. The API is very similar to the PHP/CURL one as you will see and you should then quickly realize that --data translates to CURLOPT_POSTFIELDS.
Oh, and you'll note that the -X usage is completely superfluous! ;-)