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

  1. Copy a cURL command from Chrome DevTools, Postman, or any source
  2. Paste it into the input field
  3. Choose your preferred output format (curl_init or Guzzle)
  4. Click "Convert to PHP" to generate the code
  5. Copy the generated PHP code for use in your project
  6. Review the request details to verify the conversion