cURL to PHP Converter
Convert cURL commands to PHP code using curl_init() or Guzzle HTTP client.
Input
Paste a cURL command from Chrome DevTools, Postman, or any source
Quick Examples
PHP Code
Generated Code:
Request Details
| Method | |
|---|---|
| URL | |
| Headers |
|
| Has Body |
Note: Guzzle requires installation via Composer:
composer require guzzlehttp/guzzle
Tip: Always validate and sanitize user input before making HTTP requests in production.
Features
- Convert cURL commands to PHP code instantly
- Support for both native PHP cURL (curl_init) and Guzzle HTTP client
- Preserves headers, authentication, and request body
- Handles GET, POST, PUT, DELETE, and other HTTP methods
- Extracts and displays request details
- Perfect for converting Chrome DevTools network requests to PHP
How to Use
- Copy a cURL command from Chrome DevTools, Postman, or any source
- Paste it into the input field
- Choose your preferred output format (curl_init or Guzzle)
- Click "Convert to PHP" to generate the code
- Copy the generated PHP code for use in your project
- Review the request details to verify the conversion