cURL class

The following sections explain each method of the class.

curl_extension_exists


public static bool curl_extension_exists ()

Controls whether or not your Web server the PHP extension curl has enabled in php.ini. This is the case, comes in response true back when an error occurs or if the extension is not found false .


get_data


public static mixed get_data ( String $url, Array $postfields = [], Boolean $ssl = false)

The method get_data sends a request to a WebURL and gets back, if all goes right, a response of the WebURL.

Parameter list
url

The WebURL to be called.

postfields

If you would like to transmit certain data to the WebURL, you can specify an associative array. This data is being sent then with the WebURL as POST on the call. By default, the parameter is empty.

ssl

If there is an SSL connection (https), this one can here with a true specify. By default afalse


downloadFile (from v2.4.0)


public static bool downloadFile ( string $url, string $destination)

Downloads a file from a Web server and stores the file on the local Web server.

Parameter list
url

The Web URL where is the file to be downloaded.

destination

The absolute path on the local server where the downloaded file is to be saved.


get_status


public static int get_status ( String $url)

Gets or sets the HTTP status code of a WebURL.

Parameter list
url

The WebURL whose HTTP-status code should be checked.


get_city_coordinates


public static object get_city_coordinates ( String $city)

The method get_city_coordinates returns lengths and latitudes an address / city.

Parameter list
city

The name of the city or a complete address. It should be noted that if the town several times exists with the same name in the world, a distorted result could come back. You can bypass that by giving the complete address.


get_city_name_by_ip


public static string get_city_name_by_ip ()

Returns the name of the city from the own IP address. The accuracy can vary greatly here. The queries from foreign IP addresses is here but not possible. If the method should find no city due to for example a proxy returns ,,Not found".