Curl
in package
cURL session manager
Table of Contents
- $ch : mixed
- __construct() : mixed
- Initialize a cURL session
- __destruct() : mixed
- Closes a cURL session and frees all resources. The cURL handle, ch, is also deleted.
- errno() : int
- error() : string
- exec() : bool|string
- Perform a cURL session
- getinfo() : array<string|int, mixed>
- Gets information about the last transfer.
- setoptArray() : bool
- Set multiple options for a cURL transfer
Properties
$ch
private
mixed
$ch
Methods
__construct()
Initialize a cURL session
public
__construct(string $url) : mixed
Parameters
- $url : string
Return values
mixed —__destruct()
Closes a cURL session and frees all resources. The cURL handle, ch, is also deleted.
public
__destruct() : mixed
Return values
mixed —errno()
public
errno() : int
Return values
int —Returns the error number or 0 (zero) if no error occurred.
error()
public
error() : string
Return values
string —Returns the error message or '' (the empty string) if no error occurred.
exec()
Perform a cURL session
public
exec() : bool|string
Return values
bool|string —Returns TRUE on success or FALSE on failure. However, if the CURLOPT_RETURNTRANSFER option is set, it will return the result on success, FALSE on failure.
getinfo()
Gets information about the last transfer.
public
getinfo() : array<string|int, mixed>
Return values
array<string|int, mixed> —setoptArray()
Set multiple options for a cURL transfer
public
setoptArray(array<string|int, mixed> $options) : bool
Parameters
- $options : array<string|int, mixed>
-
Returns TRUE if all options were successfully set. If an option could not be successfully set, FALSE is immediately returned, ignoring any future options in the options array.