Convert curl commands to PHP code in your browser
Switch branches/tags
Nothing to show
Clone or download
incarnate Merge pull request #6 from pifagor87/fixeb_bug_pifagor
Remove extra quotes from post fields
Latest commit 56fcce3 Jan 30, 2018
Permalink
Failed to load latest commit information.
resources Update curl-to-php.js Sep 8, 2017
LICENSE.txt Initial commit Feb 13, 2016
README.md Initial commit Feb 13, 2016
index.html Add support for --data-binary Jan 14, 2017

README.md

Curl-to-PHP

Curl-to-PHP is a tool to instantly convert curl commands to PHP code in the browser. It does not guarantee high-fidelity conversions, but it's good enough for most API docs that have curl samples.

This is a derivitive of curl-to-Go, which converts curl to a Go.

Try it

Check it out! It works inside your browser. Just give the code a once-over since you may want to improve the error handling.

FAQ

Does any curl command work?

Any curl command should work, but only certain flags are understood and converted into PHP code. The rest of the flags will be ignored.

Which kinds of curl commands are understood?

Mostly simple HTTP commands (headers, basic auth, body, etc).

Will you consider supporting this-or-that flag?

curl has like a bajillion options, so don't expect all of them to be implemented; just the most common/important ones to stub out code from API samples and docs, etc. But feel free to open an issue or submit a pull request!

Credits

Curl-to-PHP is brought to you by John C (@incarnated), based on the work of Matt Holt (mholt6).