URL, HTTP & APIs
cURL to PHP Converter
Paste a curl command and get concise PHP curl_* code you can
drop into a script. Quoting, line continuations, headers, bodies and auth are parsed
in your browser — nothing is uploaded.
curl command
shell
Line continuations (\), single quotes and double quotes are
supported. Paste straight from your terminal or API docs.
Parsed request
—- Method
- —
- URL
- —
- Body
- —
Headers 0
No headers in this request.
PHP
curl_*Tip: press Ctrl/Cmd + Enter to copy the PHP.
How it works
The command is split into arguments the same way a shell would, then each flag is
mapped onto its PHP cURL equivalent: -H becomes
CURLOPT_HTTPHEADER, -d becomes
CURLOPT_POSTFIELDS, -u becomes
CURLOPT_USERPWD, and so on. Anything that cannot be translated is
called out as a note instead of silently dropped. The generated snippet is plain
PHP using the bundled cURL extension, and your command never leaves this page.