PHP Using cURL in PHP

Help us to keep this website almost Ad Free! It takes only 10 seconds of your time:
> Step 1: Go view our video on YouTube: EF Core Bulk Insert
> Step 2: And Like the video. BONUS: You can also share it!

Syntax

  • resource curl_init ([ string $url = NULL ] )
  • bool curl_setopt ( resource $ch , int $option , mixed $value )
  • bool curl_setopt_array ( resource $ch, array $options )
  • mixed curl_exec ( resource $ch )
  • void curl_close ( resource $ch )

Parameters

ParameterDetails
curl_init-- Initialize a cURL session
urlThe url to be used in the cURL request
curl_setopt-- Set an option for a cURL transfer
chThe cURL handle (return value from curl_init())
optionCURLOPT_XXX to be set - see PHP documentation for the list of options and acceptable values
valueThe value to be set on the cURL handle for the given option
curl_exec-- Perform a cURL session
chThe cURL handle (return value from curl_init())
curl_close-- Close a cURL session
chThe cURL handle (return value from curl_init())


Got any PHP Question?