cURL to PHP
Paste a cURL command below.
Paste a cURL command and convert it into PHP cURL code. URL, method, headers, body and auth map to curl_setopt calls with the response echoed.
Paste a cURL command below.
The parser extracts the method, URL, headers and body, then emits PHP using curl_init and curl_setopt. Custom methods use CURLOPT_CUSTOMREQUEST, headers become a CURLOPT_HTTPHEADER array, and -u becomes CURLOPT_USERPWD.
Many PHP integrations start life as a cURL example in API docs. The generated snippet drops into Laravel, WordPress or plain PHP and runs as written, returning the response as a string.