https://github.com/incarnate/curl-to-php
Convert curl commands to PHP code in your browser
https://github.com/incarnate/curl-to-php
converts-curl curl php
Last synced: 2 months ago
JSON representation
Convert curl commands to PHP code in your browser
- Host: GitHub
- URL: https://github.com/incarnate/curl-to-php
- Owner: incarnate
- License: mit
- Created: 2016-02-13T23:05:53.000Z (over 9 years ago)
- Default Branch: gh-pages
- Last Pushed: 2022-02-07T08:58:58.000Z (over 3 years ago)
- Last Synced: 2025-03-29T09:11:39.300Z (2 months ago)
- Topics: converts-curl, curl, php
- Language: JavaScript
- Homepage: https://incarnate.github.io/curl-to-php/
- Size: 80.1 KB
- Stars: 405
- Watchers: 14
- Forks: 147
- Open Issues: 19
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE.txt
Awesome Lists containing this project
README
Curl-to-PHP
===========Curl-to-PHP is a tool to instantly convert [curl](http://curl.haxx.se) 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](http://mholt.github.io/curl-to-go/), which converts curl to a Go.
### Try it
**[Check it out!](https://incarnate.github.io/curl-to-php)** 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](https://twitter.com/incarnated)), based on the work of Matt Holt ([mholt6](https://twitter.com/mholt6)).