Hướng dẫn php curl not working on localhost - php curl không hoạt động trên localhost

Tôi đang sử dụng Mamp Pro 1.9.4 trên Mac OSX trong phpinfo() Tôi thấy Curl được bật
In phpinfo() I see curl is enabled

Show
cURL support    enabled
cURL Information    7.20.0
Age 3
Features
AsynchDNS   No
Debug   No
GSS-Negotiate   No
IDN Yes
IPv6    Yes
Largefile   Yes
NTLM    Yes
SPNEGO  No
SSL Yes
SSPI    No
krb4    No
libz    Yes
CharConv    No
Protocols   dict, file, ftp, ftps, http, https, imap, imaps, ldap, pop3, pop3s, rtsp, smtp, smtps, telnet, tftp
Host    i386-apple-darwin8.11.1
SSL Version OpenSSL/0.9.7l
ZLib Version    1.2.3

Kịch bản của tôi là mã hóa địa lý dài từ API của Google. Nó hoạt động trực tuyến trên máy chủ nhà cung cấp lưu trữ của tôi nhưng không phải trên localhost .. Tại sao ??

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}

Mikko Dot Rantalainen tại Peda Dot Net

Failed to connect() to host or proxy

Steve tại WebSmithery Dot Co Dot Uk ¶

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";

8 năm trước

Joan ¶Set an option for a cURL transfer

Gandalf trắng ¶

S.F. ¶(CurlHandle $handle, int $option, mixed $value): bool

9 năm trước

ellert at _removeme_ vankoperen dot nl ¶

v dot tverdun tại gmail dot com ¶curl_init().

John Dot David Dot Steele tại Gmail Dot Com ¶

11 năm trước

kavih7 tại yahoo dot com ¶

obones_remove_me tại miễn phí dot fr ¶

Starosielec tại googlemail dot com ¶bool for the following values of the option parameter:

Andrew ¶jid ¶14 năm trước
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
6
Andrabr tại Gmail Dot Com ¶ to automatically set the
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
8 field in requests where it follows a
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
9 redirect.
Failed to connect() to host or proxy
0
15 năm trước to mark this as a new cookie "session". It will force libcurl to ignore all cookies it is about to load that are "session cookies" from the previous session. By default, libcurl always stores and loads all cookies, independent if they are session cookies or not. Session cookies are cookies without expiry date and they are meant to be alive and existing for this "session" only.
Failed to connect() to host or proxy
2
Miloshio tại Gmail Dot Com ¶ to output SSL certification information to
Failed to connect() to host or proxy
4 on secure transfers.
w dot danford tại điện tử-software dot com ¶
Failed to connect() to host or proxy
5
to be on to have an effect.
Failed to connect() to host or proxy
6
Puhfesor tại gmail dot com tells the library to perform all the required proxy authentication and connection setup, but no data transfer. This option is implemented for HTTP, SMTP and POP3. ashooner - - gmail, com ¶
Failed to connect() to host or proxy
8
Martin K. to convert Unix newlines to CRLF newlines on transfers.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
0
Curl có hoạt động trên localhost không? to not allow URLs that include a username. Usernames are allowed by default (0). Nó cũng hoạt động cho localhost, vì Curl sẽ kiểm tra bộ đệm trước khi giải quyết nội bộ và giải quyết -giải quyết lưu trữ bộ đệm DNS với các mục đã cho. (Được cung cấp cho các ứng dụng thông qua tùy chọn Curlopt_Resolve.)
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
2
Tôi có thể sử dụng Curl trong PHP không? to shuffle the order of all returned addresses so that they will be used in a random order, when a name is resolved and more than one IP address is returned. This may cause IPv4 to be used before IPv6 or vice versa. Việc sử dụng Curl trong PHP Curl là tiện ích mở rộng PHP cho phép bạn sử dụng cú pháp URL để nhận và gửi dữ liệu. Curl làm cho nó đơn giản để kết nối giữa các trang web và tên miền khác nhau. Có được một bản sao tài liệu của một trang web. Đệ trình các biểu mẫu tự động, xác thực và sử dụng cookie.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
4
(Php 4> = 4.0.2, Php 5, Php 7, Php 8) to send an HAProxy PROXY protocol v1 header at the start of the connection. The default action is not to send this header. Được thêm vào Curl 7.60.0. Có sẵn từ Php 7.3.0.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
6
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để kích hoạt nén SSH tích hợp. Đây là một yêu cầu, không phải là một đơn đặt hàng; Máy chủ có thể hoặc không thể làm điều đó.
to enable built-in SSH compression. This is a request, not an order; the server may or may not do it.
Được thêm vào Curl 7.56.0. Có sẵn từ Php 7.3.0.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
8
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để sử dụng bộ đệm DNS toàn cầu. Tùy chọn này không an toàn cho luồng. Nó được bật theo mặc định nếu PHP được xây dựng để sử dụng không có luồng (CLI, FCGI, Apache2-Prefork, v.v.).
to use a global DNS cache. This option is not thread-safe. It is conditionally enabled by default if PHP is built for non-threaded use (CLI, FCGI, Apache2-Prefork, etc.).
phpinfo()0
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để thất bại một cách xác minh nếu mã HTTP được trả về lớn hơn hoặc bằng 400. Hành vi mặc định là trả về trang bình thường, bỏ qua mã.
to fail verbosely if the HTTP code returned is greater than or equal to 400. The default behavior is to return the page normally, ignoring the code.
phpinfo()2
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để kích hoạt TLS bắt đầu sai.
to enable TLS false start.
Được thêm vào Curl 7.42.0. Có sẵn kể từ Php 7.0.7.
phpinfo()4
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để cố gắng truy xuất ngày sửa đổi của tài liệu từ xa. Giá trị này có thể được truy xuất bằng tùy chọn phpinfo()6 với Curl_GetInfo ().
to attempt to retrieve the modification date of the remote document. This value can be retrieved using the phpinfo()6 option with curl_getinfo().
phpinfo()7
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để làm theo bất kỳ tiêu đề phpinfo()9 nào mà máy chủ gửi là một phần của tiêu đề HTTP. Xem thêm $handle0.
to follow any phpinfo()9 header that the server sends as part of the HTTP header. See also $handle0.
$handle1
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để buộc kết nối đến gần rõ ràng khi nó đã hoàn thành quá trình xử lý và không được gộp lại để tái sử dụng.
to force the connection to explicitly close when it has finished processing, and not be pooled for reuse.
$handle3
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để buộc sử dụng kết nối mới thay vì được lưu trữ trong bộ nhớ cache.
to force the use of a new connection instead of a cached one.
$handle5
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để sử dụng EPRT (và LPRT) khi thực hiện tải xuống FTP hoạt động. Sử dụng $handle7 để vô hiệu hóa EPRT và LPRT và chỉ sử dụng cổng.
to use EPRT (and LPRT) when doing active FTP downloads. Use $handle7 to disable EPRT and LPRT and use PORT only.
$handle8
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Trước tiên hãy thử lệnh EPSV để chuyển FTP trước khi quay lại PASV. Đặt thành $handle7 thành Tắt EPSV.
to first try an EPSV command for FTP transfers before reverting back to PASV. Set to $handle7 to disable EPSV.
$option1
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để tạo các thư mục bị thiếu khi một hoạt động FTP gặp phải một đường dẫn hiện không tồn tại.
to create missing directories when an FTP operation encounters a path that currently doesn't exist.
$option3
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để nối vào tệp từ xa thay vì ghi đè lên nó.
to append to the remote file instead of overwriting it.
$option5
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để vô hiệu hóa thuật toán NAGLE của TCP, cố gắng giảm thiểu số lượng gói nhỏ trên mạng.
to disable TCP's Nagle algorithm, which tries to minimize the number of small packets on the network.
Có sẵn cho các phiên bản được biên dịch với LibCurl 7.11.2 trở lên.
$option7 Một bí danh của $option8. Sử dụng điều đó thay thế.$option8. Use that instead.
$option9
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 chỉ liệt kê tên của thư mục FTP.
to only list the names of an FTP directory.
$value1
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để bao gồm tiêu đề trong đầu ra.
to include the header in the output.
$value3
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để theo dõi chuỗi yêu cầu của tay cầm.
to track the handle's request string.
Tiền tố $value5 là cố ý.$value5 prefix is intentional.
$value6 Có cho phép phản hồi HTTP/0,9 hay không. Mặc định là $handle7 kể từ Libcurl 7.66.0; Trước đây nó mặc định là
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7.$handle7 as of libcurl 7.66.0; formerly it defaulted to
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7
.
Có sẵn từ Php 7.3.15 và 7.4.3, nếu được xây dựng dựa trên LibCurl> = 7.64.0
$value9
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để đặt lại phương thức yêu cầu HTTP để nhận. Vì GET là mặc định, điều này chỉ cần thiết nếu phương thức yêu cầu đã được thay đổi.
to reset the HTTP request method to GET. Since GET is the default, this is only necessary if the request method has been changed.
handle1
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 đến đường hầm thông qua một proxy HTTP đã cho.
to tunnel through a given HTTP proxy.
handle3 $handle7 để có được cơ thể phản hồi HTTP thô. to get the raw HTTP response body. Có sẵn nếu được xây dựng chống lại libcurl> = 7.16.2.
handle5
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để tiếp tục gửi thân yêu cầu nếu mã HTTP được trả về bằng hoặc lớn hơn 300. Hành động mặc định sẽ ngừng gửi và đóng luồng hoặc kết nối. Thích hợp cho xác thực NTLM thủ công. Hầu hết các ứng dụng không cần tùy chọn này.
to keep sending the request body if the HTTP code returned is equal to or larger than 300. The default action would be to stop sending and close the stream or connection. Suitable for manual NTLM authentication. Most applications do not need this option.
Có sẵn kể từ Php 7.3.0 nếu được xây dựng dựa trên LibCurl> = 7.51.0.
handle7
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 hoàn toàn im lặng liên quan đến các chức năng Curl.
to be completely silent with regards to the cURL functions.
Đã xóa trong Curl 7.15.5 (thay vào đó bạn có thể sử dụng Curlopt_returnTransfer)
handle9
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để quét tệp ~/.Netrc để tìm tên người dùng và mật khẩu cho trang web từ xa mà kết nối đang được thiết lập.
to scan the ~/.netrc file to find a username and password for the remote site that a connection is being established with.
option1
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để loại trừ cơ thể khỏi đầu ra. Phương thức yêu cầu sau đó được đặt thành đầu. Thay đổi điều này thành $handle7 không thay đổi nó để có được.
to exclude the body from the output. Request method is then set to HEAD. Changing this to $handle7 does not change it to GET.
option4

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để vô hiệu hóa đồng hồ đo tiến độ để chuyển curl. to disable the progress meter for cURL transfers.

Ghi chú::

PHP tự động đặt tùy chọn này thành

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7, điều này chỉ nên được thay đổi cho mục đích gỡ lỗi.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7
, this should only be changed for debugging purposes.

option7
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để bỏ qua bất kỳ chức năng Curl nào gây ra tín hiệu được gửi đến quy trình PHP. Điều này được bật theo mặc định trong SAPIS đa luồng để các tùy chọn thời gian chờ vẫn có thể được sử dụng.
to ignore any cURL function that causes a signal to be sent to the PHP process. This is turned on by default in multi-threaded SAPIs so timeout options can still be used.
Được thêm vào Curl 7.10.
option9
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để không xử lý các chuỗi chấm.
to not handle dot dot sequences.
Được thêm vào Curl 7.42.0. Có sẵn kể từ Php 7.0.7.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
01
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để cố gắng truy xuất ngày sửa đổi của tài liệu từ xa. Giá trị này có thể được truy xuất bằng tùy chọn phpinfo()6 với Curl_GetInfo ().
to wait for pipelining/multiplexing.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để làm theo bất kỳ tiêu đề phpinfo()9 nào mà máy chủ gửi là một phần của tiêu đề HTTP. Xem thêm $handle0.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
03
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để buộc kết nối đến gần rõ ràng khi nó đã hoàn thành quá trình xử lý và không được gộp lại để tái sử dụng.
to do a regular HTTP POST. This POST is the normal
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
05 kind, most commonly used by HTML forms.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
06
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để buộc sử dụng kết nối mới thay vì được lưu trữ trong bộ nhớ cache.
to HTTP PUT a file. The file to PUT must be set with
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
08
and
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
09
.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
10
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để sử dụng EPRT (và LPRT) khi thực hiện tải xuống FTP hoạt động. Sử dụng $handle7 để vô hiệu hóa EPRT và LPRT và chỉ sử dụng cổng.
to return the transfer as a string of the return value of curl_exec() instead of outputting it directly.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
12
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Trước tiên hãy thử lệnh EPSV để chuyển FTP trước khi quay lại PASV. Đặt thành $handle7 thành Tắt EPSV.
to enable sending the initial response in the first packet.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để tạo các thư mục bị thiếu khi một hoạt động FTP gặp phải một đường dẫn hiện không tồn tại.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
14
$handle7 để vô hiệu hóa ALPN trong bắt tay SSL (nếu LibCurl phụ trợ SSL được xây dựng để sử dụng hỗ trợ nó), có thể được sử dụng để đàm phán HTTP2. to disable ALPN in the SSL handshake (if the SSL backend libcurl is built to use supports it), which can be used to negotiate http2. Được thêm vào Curl 7.36.0. Có sẵn kể từ Php 7.0.7.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
16
$handle7 để vô hiệu hóa NPN trong bắt tay SSL (nếu LibCurl phụ trợ SSL được xây dựng để sử dụng hỗ trợ nó), có thể được sử dụng để đàm phán HTTP2. to disable NPN in the SSL handshake (if the SSL backend libcurl is built to use supports it), which can be used to negotiate http2. Được thêm vào Curl 7.36.0. Có sẵn kể từ Php 7.0.7.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
18
$handle7 để vô hiệu hóa NPN trong bắt tay SSL (nếu LibCurl phụ trợ SSL được xây dựng để sử dụng hỗ trợ nó), có thể được sử dụng để đàm phán HTTP2. to stop cURL from verifying the peer's certificate. Alternate certificates to verify against can be specified with the
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
20
option or a certificate directory can be specified with the
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
21
option.
$handle7 để ngăn Curl xác minh chứng chỉ ngang hàng. Chứng chỉ thay thế để xác minh có thể được chỉ định với tùy chọn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
20 hoặc thư mục chứng chỉ có thể được chỉ định với tùy chọn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
21.
by default as of cURL 7.10. Default bundle installed as of cURL 7.10.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
23
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Theo mặc định kể từ Curl 7.10. Gói mặc định được cài đặt như Curl 7.10.
to verify the certificate's status.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để xác minh trạng thái của chứng chỉ.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
25
Được thêm vào Curl 7.41.0. Có sẵn kể từ Php 7.0.7. to stop cURL from verifying the peer's certificate. Alternate certificates to verify against can be specified with the
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
20
option or a certificate directory can be specified with the
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
21
option. When set to false, the peer certificate verification succeeds regardless.
$handle7 để ngăn Curl xác minh chứng chỉ ngang hàng. Chứng chỉ thay thế để xác minh có thể được chỉ định với tùy chọn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
20 hoặc thư mục chứng chỉ có thể được chỉ định với tùy chọn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
21. Khi được đặt thành sai, xác minh chứng chỉ ngang hàng thành công bất kể.
by default. Available since PHP 7.3.0 and libcurl >= cURL 7.52.0.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
30
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Theo mặc định. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7
, what disables support for the
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
32 prefix for uploading files in
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
33
, which means that values starting with
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
32 can be safely passed as fields. CURLFile may be used for uploads instead.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
35
Luôn luôn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7, những gì vô hiệu hóa hỗ trợ cho tiền tố
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
32 để tải lên các tệp trong
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
33, điều đó có nghĩa là các giá trị bắt đầu bằng
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
32 có thể được truyền một cách an toàn dưới dạng các trường. Curlfile có thể được sử dụng để tải lên thay thế.
to suppress proxy CONNECT response headers from the user callback functions
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
37
and
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
38
, when handle1 is used and a CONNECT request is made.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để triệt tiêu các tiêu đề phản hồi kết nối proxy từ các chức năng gọi lại của người dùng
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
37 và
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
38, khi handle1 được sử dụng và yêu cầu kết nối được thực hiện.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
40
Được thêm vào Curl 7.54.0. Có sẵn từ Php 7.3.0. to enable TCP Fast Open.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để bật TCP nhanh mở.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
42
Được thêm vào Curl 7.49.0. Có sẵn kể từ Php 7.0.7. to not send TFTP options requests.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để không gửi các yêu cầu tùy chọn TFTP.
$option8 Được thêm vào Curl 7.48.0. Có sẵn kể từ Php 7.0.7. to use ASCII mode for FTP transfers. For LDAP, it retrieves data in plain text instead of HTML. On Windows systems, it will not set
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
46 to binary mode.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
47
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để sử dụng chế độ ASCII để chuyển FTP. Đối với LDAP, nó lấy dữ liệu bằng văn bản đơn giản thay vì HTML. Trên các hệ thống Windows, nó sẽ không đặt
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
46 thành chế độ nhị phân.
to keep sending the username and password when following locations (using phpinfo()7), even when the hostname has changed.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
50
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để tiếp tục gửi tên người dùng và mật khẩu khi các vị trí theo dõi (sử dụng phpinfo()7), ngay cả khi tên máy chủ đã thay đổi.
to prepare for an upload.
Failed to connect() to host or proxy
5
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 để chuẩn bị cho một tải lên.
to output verbose information. Writes output to
Failed to connect() to host or proxy
4, or the file specified using
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
55
.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 Để đầu ra thông tin dài dòng. Ghi đầu ra vào
Failed to connect() to host or proxy
4 hoặc tệp được chỉ định bằng
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
55.int for the following values of the option parameter:

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 phải là INT cho các giá trị sau của tham số option:
Quyền muaĐặt
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 thành
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
59
Ghi chú Kích thước của bộ đệm để sử dụng cho mỗi lần đọc. Không có gì đảm bảo yêu cầu này sẽ được đáp ứng, tuy nhiên.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
60
Được thêm vào Curl 7.10.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
61
Số giây để chờ trong khi cố gắng kết nối. Sử dụng 0 để đợi vô thời hạn. Số lượng mili giây để chờ đợi trong khi cố gắng kết nối. Sử dụng 0 để đợi vô thời hạn. Nếu LibCurl được xây dựng để sử dụng trình phân giải tên hệ thống tiêu chuẩn, thì phần kết nối đó vẫn sẽ sử dụng độ phân giải toàn giây cho thời gian chờ với thời gian chờ tối thiểu cho phép một giây.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
62
Được thêm vào Curl 7.16.2.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
63
Số giây để giữ các mục DNS trong bộ nhớ. Tùy chọn này được đặt thành 120 (2 phút) theo mặc định. Được thêm vào Curl 7.36.0. Có sẵn kể từ Php 7.0.7.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
64
Thời gian chờ đợi cho kỳ vọng: Phản hồi tiếp tục 100 trong mili giây. Mặc định là 1000 mili giây. BẮT ĐẦU CHO IPV6 cho thuật toán Happy Eyeballs. Happy Eyeballs cố gắng kết nối với cả địa chỉ IPv4 và IPv6 cho máy chủ ngăn xếp kép, thích IPv6 trước cho thời gian chờ mili giây. Mặc định là Curl_Het_Default, hiện là 200 mili giây.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
65
Được thêm vào Curl 7.59.0. Có sẵn từ Php 7.3.0. Phương thức xác thực FTP (khi được kích hoạt):
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
66 (thử SSL đầu tiên),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
67 (thử TLS đầu tiên) hoặc
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
68 (hãy quyết định Curl).
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
69
Được thêm vào Curl 7.12.2.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
70
: the headers specified in
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
71
will be used in requests both to servers and proxies. With this option enabled,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72
will not have any effect.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
73
: makes
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
71
headers only get sent to a server and not to a proxy. Proxy headers must be set with
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72
to get used. Note that if a non-CONNECT request is sent to a proxy, libcurl will send both server headers and proxy headers. When doing CONNECT, libcurl will send
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72
headers only to the proxy and then
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
71
headers only to the server.
Defaults to
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
73
as of cURL 7.42.1, and
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
70
before.
Làm thế nào để đối phó với các tiêu đề. Một trong các hằng số sau:
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
70: Các tiêu đề được chỉ định trong
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
71 sẽ được sử dụng trong các yêu cầu cả cho máy chủ và proxy. Với tùy chọn này được bật,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72 sẽ không có bất kỳ hiệu ứng nào.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
73: Làm cho các tiêu đề
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
71 chỉ được gửi đến một máy chủ và không đến một proxy. Tiêu đề proxy phải được đặt với
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72 để được sử dụng. Lưu ý rằng nếu yêu cầu không kết nối được gửi đến proxy, LibCurl sẽ gửi cả tiêu đề máy chủ và tiêu đề proxy. Khi kết nối, LibCurl sẽ chỉ gửi các tiêu đề
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72 đến proxy và sau đó chỉ các tiêu đề
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
71 đến máy chủ. Mặc định là
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
73 kể từ Curl 7.42.1 và
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
70 trước.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
80
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
81 (mặc định, cho phép Curl quyết định sử dụng phiên bản nào),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
82 (Lực lượng http/1.0),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
83 (lực lượng http/1.1),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
84 (cố gắng .
(default, lets CURL decide which version to use),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
82
(forces HTTP/1.0),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
83
(forces HTTP/1.1),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
84
(attempts HTTP 2),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
85
(alias of
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
84
),
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
87
(attempts HTTP 2 over TLS (HTTPS) only) or
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
88
(issues non-TLS HTTP requests using HTTP/2 without HTTP/1.1 Upgrade).
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
89

(Các) phương pháp xác thực HTTP để sử dụng. Các tùy chọn là:

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
90,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
91,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
92,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
93,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
94 và
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
95.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
90
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
91
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
92
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
93
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
94
, and
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
95
.

Toán tử bitwise

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
96 (hoặc) có thể được sử dụng để kết hợp nhiều hơn một phương pháp. Nếu điều này được thực hiện, Curl sẽ thăm dò máy chủ để xem phương pháp nào nó hỗ trợ và chọn phương pháp tốt nhất.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
94 là bí danh cho
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
98.
is an alias for
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
98.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
95 là bí danh cho
Failed to connect() to host or proxy
00.
is an alias for
Failed to connect() to host or proxy
00.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
09
Kích thước dự kiến, tính theo byte, của tệp khi tải tệp lên một trang web từ xa. Lưu ý rằng việc sử dụng tùy chọn này sẽ không ngăn LibCurl gửi thêm dữ liệu, vì chính xác những gì được gửi phụ thuộc vào
Failed to connect() to host or proxy
02.
Failed to connect() to host or proxy
02
.
Failed to connect() to host or proxy
03
Tốc độ chuyển, tính theo byte mỗi giây, việc chuyển nên ở dưới trong số lượng
Failed to connect() to host or proxy
04 giây trước khi PHP xem xét việc chuyển quá chậm và phá thai.
Failed to connect() to host or proxy
04
seconds before PHP considers the transfer too slow and aborts.
Failed to connect() to host or proxy
04
Số giây tốc độ truyền phải dưới
Failed to connect() to host or proxy
03 trước khi PHP xem xét việc chuyển quá chậm và hủy bỏ.
Failed to connect() to host or proxy
03
before PHP considers the transfer too slow and aborts.
Failed to connect() to host or proxy
07
Số lượng tối đa của các kết nối liên tục được cho phép. Khi đạt đến giới hạn, cái cũ nhất trong bộ đệm được đóng để ngăn chặn số lượng kết nối mở.
$handle0 Số lượng tối đa của các chuyển hướng HTTP để làm theo. Sử dụng tùy chọn này cùng với phpinfo()7. Giá trị mặc định của
Failed to connect() to host or proxy
10 được đặt để ngăn chặn chuyển hướng vô hạn. Cài đặt thành
Failed to connect() to host or proxy
11 cho phép chuyển hướng inifinite và
Failed to connect() to host or proxy
12 từ chối tất cả các chuyển hướng.phpinfo()7. Default value of
Failed to connect() to host or proxy
10 is set to prevent infinite redirects. Setting to
Failed to connect() to host or proxy
11 allows inifinite redirects, and
Failed to connect() to host or proxy
12 refuses all redirects.
Failed to connect() to host or proxy
13
Một số cổng khác để kết nối với.
Failed to connect() to host or proxy
14
Một bitmask 1 (301 đã di chuyển vĩnh viễn), 2 (302 tìm thấy) và 4 (303 xem khác) nếu phương thức bài HTTP nên được duy trì khi phpinfo()7 được đặt và một loại chuyển hướng cụ thể xảy ra.phpinfo()7 is set and a specific type of redirect occurs. Được thêm vào Curl 7.19.1.
Failed to connect() to host or proxy
16

Bitmask của các giá trị

Failed to connect() to host or proxy
17. Nếu được sử dụng, Bitmask này giới hạn những giao thức mà LibCurl có thể sử dụng trong quá trình chuyển nhượng. Điều này cho phép bạn có một libcurl được xây dựng để hỗ trợ một loạt các giao thức nhưng vẫn giới hạn các chuyển khoản cụ thể chỉ được phép sử dụng một tập hợp con của chúng. Theo mặc định, LibCurl sẽ chấp nhận tất cả các giao thức mà nó hỗ trợ. Xem thêm
Failed to connect() to host or proxy
18.
Failed to connect() to host or proxy
17
values. If used, this bitmask limits what protocols libcurl may use in the transfer. This allows you to have a libcurl built to support a wide range of protocols but still limit specific transfers to only be allowed to use a subset of them. By default libcurl will accept all protocols it supports. See also
Failed to connect() to host or proxy
18
.

Các tùy chọn giao thức hợp lệ là:

Failed to connect() to host or proxy
19,
Failed to connect() to host or proxy
20,
Failed to connect() to host or proxy
21,
Failed to connect() to host or proxy
22,
Failed to connect() to host or proxy
23,
Failed to connect() to host or proxy
24,
Failed to connect() to host or proxy
25,
Failed to connect() to host or proxy
26,
Failed to connect() to host or proxy
27,
Failed to connect() to host or proxy
28,
Failed to connect() to host or proxy
2
Failed to connect() to host or proxy
19
,
Failed to connect() to host or proxy
20
,
Failed to connect() to host or proxy
21
,
Failed to connect() to host or proxy
22
,
Failed to connect() to host or proxy
23
,
Failed to connect() to host or proxy
24
,
Failed to connect() to host or proxy
25
,
Failed to connect() to host or proxy
26
,
Failed to connect() to host or proxy
27
,
Failed to connect() to host or proxy
28
,
Failed to connect() to host or proxy
29
,
Failed to connect() to host or proxy
30
,
Failed to connect() to host or proxy
31

Được thêm vào Curl 7.19.4.
Failed to connect() to host or proxy
32
(Các) phương thức xác thực HTTP để sử dụng cho kết nối proxy. Sử dụng cùng một bitmasks như được mô tả trong
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
89. Để xác thực proxy, chỉ
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
90 và
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
93 hiện đang được hỗ trợ.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
89
. For proxy authentication, only
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
90
and
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
93
are currently supported.
Được thêm vào Curl 7.10.7.
Failed to connect() to host or proxy
36
Số cổng của proxy để kết nối. Số cổng này cũng có thể được đặt trong
Failed to connect() to host or proxy
37.
Failed to connect() to host or proxy
37
.
Failed to connect() to host or proxy
38
Hoặc
Failed to connect() to host or proxy
39 (mặc định),
Failed to connect() to host or proxy
40,
Failed to connect() to host or proxy
41,
Failed to connect() to host or proxy
42 hoặc
Failed to connect() to host or proxy
43.
Failed to connect() to host or proxy
39
(default),
Failed to connect() to host or proxy
40
,
Failed to connect() to host or proxy
41
,
Failed to connect() to host or proxy
42
or
Failed to connect() to host or proxy
43
.
Được thêm vào Curl 7.10.
Failed to connect() to host or proxy
18
Bitmask của các giá trị
Failed to connect() to host or proxy
17. Nếu được sử dụng, Bitmask này giới hạn những giao thức mà LibCurl có thể sử dụng trong một lần chuyển mà nó tuân theo chuyển hướng khi phpinfo()7 được bật. Điều này cho phép bạn giới hạn các chuyển khoản cụ thể chỉ được phép sử dụng một tập hợp con của các giao thức trong chuyển hướng. Theo mặc định, LibCurl sẽ cho phép tất cả các giao thức ngoại trừ Tệp và SCP. Đây là một sự khác biệt so với các phiên bản trước 7.19.4 mà vô điều kiện sẽ theo tất cả các giao thức được hỗ trợ. Xem thêm
Failed to connect() to host or proxy
16 cho các giá trị không đổi giao thức.
Failed to connect() to host or proxy
17
values. If used, this bitmask limits what protocols libcurl may use in a transfer that it follows to in a redirect when phpinfo()7 is enabled. This allows you to limit specific transfers to only be allowed to use a subset of protocols in redirections. By default libcurl will allow all protocols except for FILE and SCP. This is a difference compared to pre-7.19.4 versions which unconditionally would follow to all protocols supported. See also
Failed to connect() to host or proxy
16
for protocol constant values.
Được thêm vào Curl 7.19.4.
Failed to connect() to host or proxy
48
(Các) phương thức xác thực HTTP để sử dụng cho kết nối proxy. Sử dụng cùng một bitmasks như được mô tả trong
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
89. Để xác thực proxy, chỉ
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
90 và
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
93 hiện đang được hỗ trợ.
Failed to connect() to host or proxy
49

Được thêm vào Curl 7.10.7.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
90,
Failed to connect() to host or proxy
51
,
Failed to connect() to host or proxy
52
.

Toán tử bitwise

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
96 (hoặc) có thể được sử dụng để kết hợp nhiều hơn một phương pháp. Nếu điều này được thực hiện, Curl sẽ thăm dò máy chủ để xem phương pháp nào nó hỗ trợ và chọn phương pháp tốt nhất.

Số cổng của proxy để kết nối. Số cổng này cũng có thể được đặt trong

Failed to connect() to host or proxy
37. allows username/password authentication.

Hoặc

Failed to connect() to host or proxy
39 (mặc định),
Failed to connect() to host or proxy
40,
Failed to connect() to host or proxy
41,
Failed to connect() to host or proxy
42 hoặc
Failed to connect() to host or proxy
43.
allows GSS-API authentication.

Được thêm vào Curl 7.10. allows no authentication.

Bitmask của các giá trị

Failed to connect() to host or proxy
17. Nếu được sử dụng, Bitmask này giới hạn những giao thức mà LibCurl có thể sử dụng trong một lần chuyển mà nó tuân theo chuyển hướng khi phpinfo()7 được bật. Điều này cho phép bạn giới hạn các chuyển khoản cụ thể chỉ được phép sử dụng một tập hợp con của các giao thức trong chuyển hướng. Theo mặc định, LibCurl sẽ cho phép tất cả các giao thức ngoại trừ Tệp và SCP. Đây là một sự khác biệt so với các phiên bản trước 7.19.4 mà vô điều kiện sẽ theo tất cả các giao thức được hỗ trợ. Xem thêm
Failed to connect() to host or proxy
16 cho các giá trị không đổi giao thức.
Failed to connect() to host or proxy
58
option.

Phần bù, trong byte, để tiếp tục chuyển từ.
Failed to connect() to host or proxy
59
Phương pháp xác thực SOCKS5 để sử dụng. Các tùy chọn là:
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
90,
Failed to connect() to host or proxy
51,
Failed to connect() to host or proxy
52.
Failed to connect() to host or proxy
60
: do not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
Failed to connect() to host or proxy
61
: disable certificate revocation checks for those SSL backends where such behavior is present.
Được thêm vào Curl 7.25.0. Có sẵn kể từ Php 7.0.7.
Failed to connect() to host or proxy
62
Failed to connect() to host or proxy
63 Để xác minh rằng trường tên chung hoặc trường tên thay thế chủ đề trong chứng chỉ ngang hàng SSL khớp với tên máy chủ được cung cấp.
Failed to connect() to host or proxy
12 để không kiểm tra tên.
Failed to connect() to host or proxy
65 không nên được sử dụng. Trong môi trường sản xuất, giá trị của tùy chọn này nên được giữ ở
Failed to connect() to host or proxy
63 (giá trị mặc định).
Hỗ trợ giá trị
Failed to connect() to host or proxy
65 bị xóa trong Curl 7.28.1.
Failed to connect() to host or proxy
68
Một trong
Failed to connect() to host or proxy
69 (0),
Failed to connect() to host or proxy
70 (1),
Failed to connect() to host or proxy
71 (2),
Failed to connect() to host or proxy
72 (3),
Failed to connect() to host or proxy
73 (4),
Failed to connect() to host or proxy
74 (5) hoặc
Failed to connect() to host or proxy
75 (6). Phiên bản TLS tối đa có thể được đặt bằng cách sử dụng một trong các hằng số ____276. Cũng có thể hoặc một trong các hằng số
Failed to connect() to host or proxy
77 với một trong các hằng số
Failed to connect() to host or proxy
76.
Failed to connect() to host or proxy
79 (phiên bản tối đa được thư viện hỗ trợ),
Failed to connect() to host or proxy
80,
Failed to connect() to host or proxy
81,
Failed to connect() to host or proxy
82 hoặc
Failed to connect() to host or proxy
83.
Failed to connect() to host or proxy
69
(0),
Failed to connect() to host or proxy
70
(1),
Failed to connect() to host or proxy
71
(2),
Failed to connect() to host or proxy
72
(3),
Failed to connect() to host or proxy
73
(4),
Failed to connect() to host or proxy
74
(5) or
Failed to connect() to host or proxy
75
(6). The maximum TLS version can be set by using one of the
Failed to connect() to host or proxy
76
constants. It is also possible to OR one of the
Failed to connect() to host or proxy
77
constants with one of the
Failed to connect() to host or proxy
76
constants.
Failed to connect() to host or proxy
79
(the maximum version supported by the library),
Failed to connect() to host or proxy
80
,
Failed to connect() to host or proxy
81
,
Failed to connect() to host or proxy
82
, or
Failed to connect() to host or proxy
83
.

Ghi chú::

Đặt cược tốt nhất của bạn là không đặt cái này và để nó sử dụng mặc định. Đặt nó thành 2 hoặc 3 rất nguy hiểm khi các lỗ hổng đã biết trong SSLV2 và SSLV3.

Failed to connect() to host or proxy
84
Đặt các tùy chọn hành vi SSL proxy, là bitmask của bất kỳ hằng số nào sau đây:
Failed to connect() to host or proxy
60: Không cố gắng sử dụng bất kỳ cách giải quyết nào cho lỗ hổng bảo mật trong giao thức SSL3 và TLS1.0.
Failed to connect() to host or proxy
61: Vô hiệu hóa kiểm tra thu hồi chứng chỉ cho các phụ trợ SSL đó có hành vi đó. . (Curl> = 7.68.0)
Failed to connect() to host or proxy
60
: do not attempt to use any workarounds for a security flaw in the SSL3 and TLS1.0 protocols.
Failed to connect() to host or proxy
61
: disable certificate revocation checks for those SSL backends where such behavior is present. (curl >= 7.44.0)
Failed to connect() to host or proxy
87
: do not accept "partial" certificate chains, which it otherwise does by default. (curl >= 7.68.0)
Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
Failed to connect() to host or proxy
88
Đặt thành
Failed to connect() to host or proxy
63 để xác minh trong các trường tên chứng chỉ của proxy HTTPS so với tên proxy. Khi được đặt thành
Failed to connect() to host or proxy
12 kết nối thành công bất kể tên được sử dụng trong chứng chỉ. Sử dụng khả năng đó một cách thận trọng!
Failed to connect() to host or proxy
65 được coi là một tùy chọn gỡ lỗi trong Curl 7.28.0 trở lên. Từ Curl 7.28.1 đến 7.65.3
Failed to connect() to host or proxy
92 được trả về. Từ Curl 7.66.0 trở đi
Failed to connect() to host or proxy
65 và
Failed to connect() to host or proxy
63 được coi là cùng một giá trị. Trong môi trường sản xuất, giá trị của tùy chọn này nên được giữ ở
Failed to connect() to host or proxy
63 (giá trị mặc định).
Failed to connect() to host or proxy
92
is returned. From curl 7.66.0 onwards
Failed to connect() to host or proxy
65 and
Failed to connect() to host or proxy
63 is treated as the same value. In production environments the value of this option should be kept at
Failed to connect() to host or proxy
63 (default value).
Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
Failed to connect() to host or proxy
96
Đặt thành
Failed to connect() to host or proxy
63 để xác minh trong các trường tên chứng chỉ của proxy HTTPS so với tên proxy. Khi được đặt thành
Failed to connect() to host or proxy
12 kết nối thành công bất kể tên được sử dụng trong chứng chỉ. Sử dụng khả năng đó một cách thận trọng!
Failed to connect() to host or proxy
65 được coi là một tùy chọn gỡ lỗi trong Curl 7.28.0 trở lên. Từ Curl 7.28.1 đến 7.65.3
Failed to connect() to host or proxy
92 được trả về. Từ Curl 7.66.0 trở đi
Failed to connect() to host or proxy
65 và
Failed to connect() to host or proxy
63 được coi là cùng một giá trị. Trong môi trường sản xuất, giá trị của tùy chọn này nên được giữ ở
Failed to connect() to host or proxy
63 (giá trị mặc định).
Failed to connect() to host or proxy
69
,
Failed to connect() to host or proxy
70
,
Failed to connect() to host or proxy
73
,
Failed to connect() to host or proxy
74
,
Failed to connect() to host or proxy
75
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
02
,
Failed to connect() to host or proxy
79
,
Failed to connect() to host or proxy
80
,
Failed to connect() to host or proxy
81
,
Failed to connect() to host or proxy
82
,
Failed to connect() to host or proxy
83
or
Failed to connect() to host or proxy
72
.

Ghi chú::

Đặt cược tốt nhất của bạn là không đặt cái này và để nó sử dụng mặc định. Đặt nó thành 2 hoặc 3 rất nguy hiểm khi các lỗ hổng đã biết trong SSLV2 và SSLV3.

Failed to connect() to host or proxy
69 which will attempt to figure out the remote SSL protocol version.

Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
10
Đặt thành
Failed to connect() to host or proxy
63 để xác minh trong các trường tên chứng chỉ của proxy HTTPS so với tên proxy. Khi được đặt thành
Failed to connect() to host or proxy
12 kết nối thành công bất kể tên được sử dụng trong chứng chỉ. Sử dụng khả năng đó một cách thận trọng!
Failed to connect() to host or proxy
65 được coi là một tùy chọn gỡ lỗi trong Curl 7.28.0 trở lên. Từ Curl 7.28.1 đến 7.65.3
Failed to connect() to host or proxy
92 được trả về. Từ Curl 7.66.0 trở đi
Failed to connect() to host or proxy
65 và
Failed to connect() to host or proxy
63 được coi là cùng một giá trị. Trong môi trường sản xuất, giá trị của tùy chọn này nên được giữ ở
Failed to connect() to host or proxy
63 (giá trị mặc định).
Một trong số
Failed to connect() to host or proxy
69,
Failed to connect() to host or proxy
70,
Failed to connect() to host or proxy
73,
Failed to connect() to host or proxy
74,
Failed to connect() to host or proxy
75,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
02,
Failed to connect() to host or proxy
79,
Failed to connect() to host or proxy
80,
Failed to connect() to host or proxy
81,
Failed to connect() to host or proxy
82,
Failed to connect() to host or proxy
83 hoặc
Failed to connect() to host or proxy
72.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
11
Đặt cược tốt nhất của bạn là không đặt điều này và để nó sử dụng mặc định
Failed to connect() to host or proxy
69 sẽ cố gắng tìm ra phiên bản giao thức SSL từ xa.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
13
and
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
14
options, provided the operating system supports them. If set to
Failed to connect() to host or proxy
12 (default) keepalive probes are disabled.
Đặt trọng lượng luồng số (một số từ 1 đến 256).
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
13
Được thêm vào Curl 7.46.0. Có sẵn kể từ Php 7.0.7.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
11
is enabled. Not all operating systems support this option. The default is
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
18.
Đặt trọng lượng luồng số (một số từ 1 đến 256).
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
14
Được thêm vào Curl 7.46.0. Có sẵn kể từ Php 7.0.7.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
11
is enabled. Not all operating systems support this option. The default is
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
18.
Đặt trọng lượng luồng số (một số từ 1 đến 256).
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
22
Được thêm vào Curl 7.46.0. Có sẵn kể từ Php 7.0.7.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23
is treated. Use
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
24
to return the page only if it has been modified since the time specified in
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23
. If it hasn't been modified, a
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
26 header will be returned assuming $value1 is
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7
. Use
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
29
for the reverse effect. Use
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
30
to ignore
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23
and always return the page.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
30
is the default.
Nếu được đặt thành
Failed to connect() to host or proxy
65, các đầu dò giữ TCP sẽ được gửi. Độ trễ và tần suất của các đầu dò này có thể được kiểm soát bởi các tùy chọn
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
13 và
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
14, với điều kiện hệ điều hành hỗ trợ chúng. Nếu được đặt thành
Failed to connect() to host or proxy
12 (mặc định) Các đầu dò giữ được vô hiệu hóa.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
24
.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
34
Được thêm vào Curl 7.25.0.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
35
Đặt độ trễ, trong vài giây, hệ điều hành sẽ đợi trong khi kết nối không hoạt động trước khi gửi các đầu dò giữ, nếu
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
11 được bật. Không phải tất cả các hệ điều hành đều hỗ trợ tùy chọn này. Mặc định là
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
18.
Đặt khoảng thời gian, tính bằng giây, hệ điều hành sẽ chờ giữa việc gửi các đầu dò giữ, nếu
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
11 được bật. Không phải tất cả các hệ điều hành đều hỗ trợ tùy chọn này. Mặc định là
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
18.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23
Làm thế nào
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23 được đối xử. Sử dụng
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
24 để trả về trang chỉ khi nó đã được sửa đổi kể từ thời gian được chỉ định trong
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23. Nếu nó chưa được sửa đổi, tiêu đề
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
26 sẽ được trả về giả định $value1 là
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7. Sử dụng
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
29 cho hiệu ứng ngược. Sử dụng
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
30 để bỏ qua
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23 và luôn trả về trang.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
30 là mặc định.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
22
.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
38
Trước Curl 7.46.0, mặc định là
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
24.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
22
. Defaults to zero. The difference between this option and
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
23
is the type of the argument. On systems where 'long' is only 32 bit wide, this option has to be used to set dates beyond the year 2038.
Được thêm vào Curl 7.59.0. Có sẵn từ Php 7.3.0.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
41
Nếu tải xuống vượt quá tốc độ này (được tính vào byte mỗi giây) trên trung bình tích lũy trong quá trình chuyển, việc chuyển sẽ tạm dừng để giữ cho tốc độ trung bình nhỏ hơn hoặc bằng giá trị tham số. Mặc định cho tốc độ không giới hạn. Được thêm vào Curl 7.15.5.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
42
Nếu tải lên vượt quá tốc độ này (được tính vào byte mỗi giây) trên trung bình tích lũy trong quá trình chuyển, việc chuyển sẽ tạm dừng để giữ cho tốc độ trung bình nhỏ hơn hoặc bằng giá trị tham số. Mặc định cho tốc độ không giới hạn. Được thêm vào Curl 7.15.5.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
43
Nếu tải lên vượt quá tốc độ này (được tính vào byte mỗi giây) trên trung bình tích lũy trong quá trình chuyển, việc chuyển sẽ tạm dừng để giữ cho tốc độ trung bình nhỏ hơn hoặc bằng giá trị tham số. Mặc định cho tốc độ không giới hạn.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
44
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
45
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
46
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
47
. Set to
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
48
to let libcurl pick one.
Một bitmask bao gồm một hoặc nhiều
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
44,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
45,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
46,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
47. Đặt thành
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
48 để Libcurl chọn một.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
49
Được thêm vào Curl 7.16.1.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
50
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
51
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
52
, by default
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
50
.
Cho phép một ứng dụng chọn loại địa chỉ IP sẽ sử dụng khi giải quyết tên máy chủ. Điều này chỉ thú vị khi sử dụng tên máy chủ giải quyết địa chỉ bằng nhiều phiên bản IP, các giá trị có thể là
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
50,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
51,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
52, theo mặc định
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
50.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
54
Được thêm vào Curl 7.10.8.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
55
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
56
and
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
57
.
Cho Curl sử dụng phương thức nào để tiếp cận tệp trên máy chủ FTP (S). Các giá trị có thể là
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
55,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
56 và
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
57.

Được thêm vào Curl 7.15.1.string for the following values of the option parameter:

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 phải là một chuỗi cho các giá trị sau của tham số option:
Quyền muaĐặt
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 thành
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
61
Ghi chústring. This option shares the same semantics as
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
62
. These two options share the same storage and therefore only one of them can be set per handle.
Cho phép sử dụng ổ cắm miền UNIX trừu tượng thay vì thiết lập kết nối TCP thành máy chủ và đặt đường dẫn đến chuỗi đã cho. Tùy chọn này có chung ngữ nghĩa với
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
62. Hai tùy chọn này có chung lưu trữ và do đó chỉ có một trong số chúng có thể được đặt cho mỗi tay cầm.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
20
Có sẵn kể từ Php 7.3.0 và Curl 7.53.0
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
18
.
Tên của một tệp giữ một hoặc nhiều chứng chỉ để xác minh ngang hàng. Điều này chỉ có ý nghĩa khi được sử dụng kết hợp với
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
18.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
21
Có thể yêu cầu một con đường tuyệt đối.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
18
.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
67
Một thư mục chứa nhiều chứng chỉ CA. Sử dụng tùy chọn này cùng với
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
18.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
70
Nội dung của tiêu đề
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
68 sẽ được sử dụng trong yêu cầu HTTP. Lưu ý rằng nhiều cookie được phân tách bằng dấu chấm phẩy theo sau là một không gian (ví dụ: "
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
69")
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
71
Tên của tệp chứa dữ liệu cookie. Tệp cookie có thể ở định dạng NetScape hoặc chỉ các tiêu đề kiểu HTTP đơn giản được đổ vào một tệp. Nếu tên là một chuỗi trống, không có cookie nào được tải, nhưng xử lý cookie vẫn được bật.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
72
Tên của một tệp để lưu tất cả các cookie nội bộ vào khi tay cầm được đóng, ví dụ: Sau khi gọi đến Curl_close.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
71
.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
77 loads all cookies from the files specified by
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
70
.
Một chuỗi cookie (tức là một dòng duy nhất ở định dạng Netscape/Mozilla hoặc tiêu đề đặt cookie kiểu HTTP thông thường) thêm cookie duy nhất vào cửa hàng cookie nội bộ.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
73 xóa tất cả các cookie được giữ trong bộ nhớ.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
74 xóa tất cả các cookie phiên được giữ trong bộ nhớ.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
75 viết tất cả các cookie đã biết vào tệp được chỉ định bởi
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
71.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
77 Tải tất cả cookie từ các tệp được chỉ định bởi
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
70.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
79

Có sẵn kể từ Curl 7.14.1.

Một phương thức yêu cầu tùy chỉnh để sử dụng thay vì

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
80 hoặc
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
81 khi thực hiện yêu cầu HTTP. Điều này rất hữu ích để thực hiện
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
82 hoặc các yêu cầu HTTP tối nghĩa hơn. Các giá trị hợp lệ là những thứ như
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
80,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
84,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
85, v.v. tức là không nhập toàn bộ dòng yêu cầu HTTP ở đây. Ví dụ, nhập
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
86 sẽ không chính xác.
:

Ghi chú:

$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
87

Đừng làm điều này mà không đảm bảo máy chủ hỗ trợ phương thức yêu cầu tùy chỉnh trước.

Giao thức mặc định để sử dụng nếu URL bị thiếu tên sơ đồ.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
88

Được thêm vào Curl 7.45.0. Có sẵn kể từ Php 7.0.7.

Đặt tên của giao diện mạng mà bộ giải quyết DNS sẽ liên kết. Đây phải là một tên giao diện (không phải là một địa chỉ).
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
89

Được thêm vào Curl 7.33.0. Có sẵn kể từ Php 7.0.7.

Đặt tên của giao diện mạng mà bộ giải quyết DNS sẽ liên kết. Đây phải là một tên giao diện (không phải là một địa chỉ).
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
90

Được thêm vào Curl 7.33.0. Có sẵn kể từ Php 7.0.7.

Đặt tên của giao diện mạng mà bộ giải quyết DNS sẽ liên kết. Đây phải là một tên giao diện (không phải là một địa chỉ).
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
91
Được thêm vào Curl 7.33.0. Có sẵn kể từ Php 7.0.7.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
92
, except a filename to an Entropy Gathering Daemon socket.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
93
Đặt địa chỉ IPv4 cục bộ mà bộ phân giải nên liên kết. Đối số phải chứa một địa chỉ IPv4 số duy nhất dưới dạng chuỗi. Đặt địa chỉ IPv6 cục bộ mà bộ phân giải nên liên kết. Đối số phải chứa một địa chỉ IPv6 số duy nhất dưới dạng chuỗi.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
99
Giá trị sẽ được sử dụng để lấy địa chỉ IP sử dụng cho lệnh "Cổng" FTP. Lệnh "cổng" cho máy chủ từ xa kết nối với địa chỉ IP được chỉ định của chúng tôi. Chuỗi có thể là một địa chỉ IP đơn giản, tên máy chủ, tên giao diện mạng (trong Unix) hoặc chỉ là một đơn giản '-' để sử dụng địa chỉ IP mặc định của hệ thống.
phpinfo()00 Tên của giao diện mạng đi để sử dụng. Đây có thể là một tên giao diện, địa chỉ IP hoặc tên máy chủ.
phpinfo()01 Mật khẩu cần thiết để sử dụng khóa riêng phpinfo()02 hoặc phpinfo()03.phpinfo()02 or phpinfo()03 private key. Được thêm vào Curl 7.16.1.
phpinfo()04 Mức bảo mật KRB4 (Kerberos 4). Bất kỳ giá trị nào sau đây (theo thứ tự ít nhất đến mạnh nhất) đều hợp lệ: phpinfo()05, phpinfo()06, phpinfo()07, phpinfo()08. Nếu chuỗi không khớp với một trong số này, phpinfo()09 sẽ được sử dụng. Đặt tùy chọn này thành phpinfo()10 sẽ vô hiệu hóa bảo mật KRB4. Hiện tại Krb4 Security chỉ hoạt động với các giao dịch FTP.phpinfo()10 will disable KRB4 security. Currently KRB4 security only works with FTP transactions.
phpinfo()11 Có thể được sử dụng để đặt các tùy chọn đăng nhập cụ thể của giao thức, chẳng hạn như cơ chế xác thực ưa thích thông qua "Auth = ntlm" hoặc "auth =*" và nên được sử dụng cùng với tùy chọn phpinfo()12.phpinfo()12 option. Được thêm vào Curl 7.34.0. Có sẵn kể từ Php 7.0.7.
phpinfo()13 Đặt khóa công khai được ghim. Chuỗi có thể là tên tệp của khóa công khai được ghim của bạn. Định dạng tệp dự kiến ​​là "PEM" hoặc "DER". Chuỗi cũng có thể là bất kỳ số lượng băm SHA256 được mã hóa Base64 trước "SHA256 //" và được phân tách bằng ";". Được thêm vào Curl 7.39.0. Có sẵn kể từ Php 7.0.7.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
33
Dữ liệu đầy đủ để đăng trong hoạt động "đăng" HTTP. Tham số này có thể được truyền dưới dạng chuỗi được mã hóa URLENCOD như 'phpinfo()15' hoặc dưới dạng mảng có tên trường là dữ liệu khóa và trường là giá trị. Nếu
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 là một mảng, tiêu đề phpinfo()17 sẽ được đặt thành phpinfo()18. Các tệp có thể được gửi bằng Curlfile hoặc CurlStringFile, trong trường hợp đó
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 phải là một mảng.
Files can be sent using CURLFile or CURLStringFile, in which case
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 must be an array.
phpinfo()20 Bất kỳ dữ liệu nên được liên kết với tay cầm Curl này. Dữ liệu này sau đó có thể được truy xuất với tùy chọn phpinfo()21 của curl_getInfo (). Curl không làm gì với dữ liệu này. Khi sử dụng tay cầm Curl Multi, dữ liệu riêng tư này thường là một khóa duy nhất để xác định tay cầm Curl tiêu chuẩn.phpinfo()21 option of curl_getinfo(). cURL does nothing with this data. When using a cURL multi handle, this private data is typically a unique key to identify a standard cURL handle. Được thêm vào Curl 7.10.3.
phpinfo()22 Đặt một chuỗi giữ tên máy chủ hoặc địa chỉ IP số chấm để được sử dụng làm preproxy có kết nối với trước khi kết nối với proxy HTTP (s) được chỉ định trong tùy chọn
Failed to connect() to host or proxy
37 cho yêu cầu sắp tới. Preproxy chỉ có thể là một proxy vớ và nó phải được đặt trước với phpinfo()24 để chỉ định loại vớ nào được sử dụng. Một địa chỉ IPv6 số phải được viết trong [dấu ngoặc]. Đặt preproxy thành một chuỗi trống vô hiệu hóa rõ ràng việc sử dụng preproxy. Để chỉ định số cổng trong chuỗi này, hãy nối phpinfo()25 vào cuối tên máy chủ. Số cổng của proxy có thể tùy ý được chỉ định với tùy chọn riêng
Failed to connect() to host or proxy
36. Mặc định sử dụng cổng 1080 cho proxy nếu một cổng không được chỉ định.string holding the host name or dotted numerical IP address to be used as the preproxy that curl connects to before it connects to the HTTP(S) proxy specified in the
Failed to connect() to host or proxy
37
option for the upcoming request. The preproxy can only be a SOCKS proxy and it should be prefixed with phpinfo()24 to specify which kind of socks is used. A numerical IPv6 address must be written within [brackets]. Setting the preproxy to an empty string explicitly disables the use of a preproxy. To specify port number in this string, append phpinfo()25 to the end of the host name. The proxy's port number may optionally be specified with the separate option
Failed to connect() to host or proxy
36
. Defaults to using port 1080 for proxies if a port is not specified.
Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
Failed to connect() to host or proxy
37
Proxy HTTP cho các yêu cầu đường hầm thông qua.
phpinfo()28 Tên dịch vụ xác thực proxy. Được thêm vào Curl 7.43.0 cho các proxy HTTP và trong Curl 7.49.0 cho các proxy SOCKS5. Có sẵn kể từ Php 7.0.7.
phpinfo()29 Đường dẫn đến gói chứng chỉ proxy (CA). Đặt đường dẫn dưới dạng chuỗi đặt tên một tệp giữ một hoặc nhiều chứng chỉ để xác minh proxy HTTPS. Tùy chọn này là để kết nối với proxy HTTPS chứ không phải máy chủ HTTPS. Các mặc định được đặt thành đường dẫn hệ thống trong đó gói cacert của LibCurl được coi là được lưu trữ.string naming a file holding one or more certificates to verify the HTTPS proxy with. This option is for connecting to an HTTPS proxy, not an HTTPS server. Defaults set to the system path where libcurl's cacert bundle is assumed to be stored. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()30 Proxy HTTP cho các yêu cầu đường hầm thông qua. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()31 Proxy HTTP cho các yêu cầu đường hầm thông qua. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()32 Proxy HTTP cho các yêu cầu đường hầm thông qua.phpinfo()33 private key. You never needed a passphrase to load a certificate but you need one to load your private key. This option is for connecting to an HTTPS proxy, not an HTTPS server. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()34 Proxy HTTP cho các yêu cầu đường hầm thông qua.Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()35 Tên tệp của chứng chỉ máy khách của bạn được sử dụng để kết nối với proxy HTTPS. Định dạng mặc định là "p12" trên vận chuyển an toàn và "PEM" trên các công cụ khác và có thể được thay đổi với phpinfo()36. Với NSS hoặc vận chuyển an toàn, đây cũng có thể là biệt danh của chứng chỉ bạn muốn xác thực với nó được đặt tên trong cơ sở dữ liệu bảo mật. Nếu bạn muốn sử dụng một tệp từ thư mục hiện tại, vui lòng đi trước nó với tiền tố "./", để tránh nhầm lẫn với một biệt danh.phpinfo()36. With NSS or Secure Transport, this can also be the nickname of the certificate you wish to authenticate with as it is named in the security database. If you want to use a file from the current directory, please precede it with "./" prefix, in order to avoid confusion with a nickname. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()36 Định dạng chứng chỉ máy khách của bạn được sử dụng khi kết nối với proxy HTTPS. Các định dạng được hỗ trợ là "PEM" và "DER", ngoại trừ với vận chuyển an toàn. OpenSSL (phiên bản 0.9.3 trở lên) và vận chuyển an toàn (trên iOS 5 trở lên hoặc OS X 10.7 trở lên) cũng hỗ trợ "P12" cho các tệp được mã hóa PKCs#12. Mặc định là "PEM".Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()38 Danh sách các mật mã để sử dụng cho kết nối với proxy HTTPS. Danh sách phải đúng về mặt cú pháp, nó bao gồm một hoặc nhiều chuỗi mật mã được phân tách bởi các dấu chấm. Dấu phẩy hoặc không gian cũng là các thiết bị phân cách chấp nhận được nhưng các đại phân thường được sử dụng,!, - và + có thể được sử dụng làm toán tử.Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()39 Danh sách các bộ mật mã để sử dụng cho kết nối TLS 1.3 với proxy. Danh sách phải đúng về mặt cú pháp, nó bao gồm một hoặc nhiều chuỗi bộ mật mã được phân tách bởi các dấu chấm. Tùy chọn này hiện chỉ được sử dụng khi Curl được xây dựng để sử dụng OpenSSL 1.1.1 trở lên. Nếu bạn đang sử dụng một phụ trợ SSL khác, bạn có thể thử cài đặt các bộ mật mã TLS 1.3 bằng cách sử dụng tùy chọn phpinfo()38.phpinfo()38 option. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.61.0. Có sẵn khi được xây dựng với OpenSSL> = 1.1.1.
phpinfo()33 Tên tệp của khóa riêng của bạn được sử dụng để kết nối với proxy HTTPS. Định dạng mặc định là "PEM" và có thể được thay đổi với phpinfo()42. .phpinfo()42. (iOS and Mac OS X only) This option is ignored if curl was built against Secure Transport. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0. Có sẵn nếu được xây dựng TLS được bật.
phpinfo()42 Định dạng của khóa riêng của bạn. Các định dạng được hỗ trợ là "PEM", "DER" và "Eng".Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()44 Mật khẩu để sử dụng cho phương thức xác thực TLS được chỉ định với tùy chọn phpinfo()45. Yêu cầu tùy chọn phpinfo()46 cũng được đặt.phpinfo()45 option. Requires that the phpinfo()46 option to also be set. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()45 Phương pháp xác thực TLS được sử dụng cho kết nối HTTPS. Phương pháp được hỗ trợ là "SRP".

Ghi chú::

Xác thực mật khẩu từ xa an toàn (SRP) cho TLS cung cấp xác thực lẫn nhau nếu cả hai bên có bí mật chung. Để sử dụng TLS-SRP, bạn cũng phải đặt các tùy chọn phpinfo()46 và phpinfo()44.phpinfo()46 and phpinfo()44 options.

Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
phpinfo()46 Tên người dùng để sử dụng cho phương thức xác thực proxy TLS của HTTPS được chỉ định với tùy chọn phpinfo()45. Yêu cầu tùy chọn phpinfo()44 cũng được đặt.phpinfo()45 option. Requires that the phpinfo()44 option to also be set. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.52.0.
Failed to connect() to host or proxy
58
Tên người dùng và mật khẩu được định dạng là phpinfo()54 để sử dụng cho kết nối với proxy.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
92
Một tên tệp được sử dụng để gieo vào trình tạo số ngẫu nhiên cho SSL.
phpinfo()56 Phạm vi dữ liệu để truy xuất theo định dạng phpinfo()57 trong đó x hoặc y là tùy chọn. Chuyển khoản HTTP cũng hỗ trợ một số khoảng, được phân tách bằng dấu phẩy ở định dạng phpinfo()58.
phpinfo()59 Nội dung của tiêu đề phpinfo()60 sẽ được sử dụng trong yêu cầu HTTP.
phpinfo()61 Tên dịch vụ xác thực. Được thêm vào Curl 7.43.0. Có sẵn kể từ Php 7.0.7.
phpinfo()62 Một chuỗi chứa 32 chữ số thập lục phân. Chuỗi phải là tổng kiểm tra MD5 của khóa công khai của máy chủ từ xa và LibCurl sẽ từ chối kết nối với máy chủ trừ khi MD5sums khớp. Tùy chọn này chỉ dành cho chuyển SCP và SFTP. Được thêm vào Curl 7.17.1.
phpinfo()63 Tên tệp cho khóa công khai của bạn. Nếu không được sử dụng, libcurl mặc định là $ home/.ssh/id_dsa.pub nếu biến môi trường gia đình được đặt và chỉ "id_dsa.pub" trong thư mục hiện tại nếu home không được đặt. Được thêm vào Curl 7.16.1.
phpinfo()03 Tên tệp cho khóa riêng của bạn. Nếu không được sử dụng, libcurl mặc định là $ home/.ssh/id_dsa nếu biến môi trường gia đình được đặt và chỉ "id_dsa" trong thư mục hiện tại nếu nhà không được đặt. Nếu tệp được bảo vệ bằng mật khẩu, hãy đặt mật khẩu với phpinfo()01.phpinfo()01. Được thêm vào Curl 7.16.1.
phpinfo()66 Tên tệp cho khóa riêng của bạn. Nếu không được sử dụng, libcurl mặc định là $ home/.ssh/id_dsa nếu biến môi trường gia đình được đặt và chỉ "id_dsa" trong thư mục hiện tại nếu nhà không được đặt. Nếu tệp được bảo vệ bằng mật khẩu, hãy đặt mật khẩu với phpinfo()01.
phpinfo()69 Tên của một tệp chứa chứng chỉ được định dạng PEM.
phpinfo()70 Mật khẩu cần thiết để sử dụng chứng chỉ phpinfo()69.phpinfo()69 certificate.
phpinfo()72 Định dạng của chứng chỉ. Các định dạng được hỗ trợ là phpinfo()73 (mặc định), phpinfo()74 và phpinfo()75. Kể từ OpenSSL 0.9.3, phpinfo()76 (đối với các tệp được mã hóa PKCS#12) cũng được hỗ trợ. Được thêm vào Curl 7.9.3.
phpinfo()77 Mã định danh cho động cơ tiền điện tử của khóa SSL riêng được chỉ định trong phpinfo()02.phpinfo()02.
phpinfo()79 Mã định danh cho động cơ tiền điện tử được sử dụng cho các hoạt động tiền điện tử không đối xứng.
phpinfo()02 Tên của một tệp chứa khóa SSL riêng.
phpinfo()81

Mật khẩu bí mật cần thiết để sử dụng khóa SSL riêng được chỉ định trong phpinfo()02.phpinfo()02.

Ghi chú::

Vì tùy chọn này chứa mật khẩu nhạy cảm, hãy nhớ giữ tập lệnh PHP, nó được chứa trong an toàn.

phpinfo()83 Loại khóa của khóa SSL riêng được chỉ định trong phpinfo()02. Các loại khóa được hỗ trợ là phpinfo()73 (mặc định), phpinfo()74 và phpinfo()75.phpinfo()02. Supported key types are phpinfo()73 (default), phpinfo()74, and phpinfo()75.
phpinfo()88 Danh sách các bộ mật mã để sử dụng cho kết nối TLS 1.3. Danh sách phải đúng về mặt cú pháp, nó bao gồm một hoặc nhiều chuỗi bộ mật mã được phân tách bởi các dấu chấm. Tùy chọn này hiện chỉ được sử dụng khi Curl được xây dựng để sử dụng OpenSSL 1.1.1 trở lên. Nếu bạn đang sử dụng một phụ trợ SSL khác, bạn có thể thử cài đặt các bộ mật mã TLS 1.3 bằng cách sử dụng tùy chọn phpinfo()66.phpinfo()66 option. Có sẵn kể từ Php 7.3.0 và libcurl> = Curl 7.61.0. Có sẵn khi được xây dựng với OpenSSL> = 1.1.1.
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
62
Cho phép sử dụng ổ cắm miền Unix làm điểm cuối kết nối và đặt đường dẫn đến chuỗi đã cho.string. Được thêm vào Curl 7.40.0. Có sẵn kể từ Php 7.0.7.
phpinfo()91 URL để lấy. Điều này cũng có thể được đặt khi khởi tạo một phiên với curl_init ().curl_init().
phpinfo()92 Nội dung của tiêu đề phpinfo()93 sẽ được sử dụng trong yêu cầu HTTP.
phpinfo()12 Tên người dùng để sử dụng trong xác thực. Được thêm vào Curl 7.19.1.
phpinfo()95 Mật khẩu để sử dụng trong xác thực. Được thêm vào Curl 7.19.1.
phpinfo()96 Mật khẩu để sử dụng trong xác thực.
phpinfo()98 Tên người dùng và mật khẩu được định dạng là phpinfo()54 để sử dụng cho kết nối. Chỉ định mã thông báo truy cập OAuth 2.0.

Được thêm vào Curl 7.33.0. Có sẵn kể từ Php 7.0.7.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 phải là một mảng cho các giá trị sau của tham số option:
Quyền muaĐặt
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 thành
$handle02 Ghi chú Kết nối với một máy chủ và cổng cụ thể thay vì máy chủ và cổng của URL. Chấp nhận một loạt các chuỗi với định dạng $handle03.
$handle04 Được thêm vào Curl 7.49.0. Có sẵn kể từ Php 7.0.7. Một mảng các phản hồi HTTP 200 sẽ được coi là phản hồi hợp lệ và không phải là lỗi.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
71
Được thêm vào Curl 7.10.3.
$handle07 Một mảng các trường tiêu đề HTTP để đặt, ở định dạng $handle06
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72
Một mảng các lệnh FTP để thực thi trên máy chủ sau khi yêu cầu FTP được thực hiện. Một mảng các tiêu đề HTTP tùy chỉnh để chuyển đến proxy.
$handle09 Được thêm vào Curl 7.37.0. Có sẵn kể từ Php 7.0.7.
$handle10 Một mảng các lệnh FTP để thực thi trên máy chủ trước yêu cầu FTP. Cung cấp một địa chỉ tùy chỉnh cho một cặp máy chủ và cổng cụ thể. Một mảng của chuỗi địa chỉ máy chủ, cổng và địa chỉ IP, mỗi phần tử được phân tách bằng một dấu hai chấm. Trong định dạng: $handle11

Được thêm vào trong Curl 7.21.3.fopen(), for example) for the following values of the option parameter:

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 phải là một mảng cho các giá trị sau của tham số option:
Quyền mua
$handle15 Đặt
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 thành
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
08
Ghi chú
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
55
Kết nối với một máy chủ và cổng cụ thể thay vì máy chủ và cổng của URL. Chấp nhận một loạt các chuỗi với định dạng $handle03.
$handle20 Được thêm vào Curl 7.49.0. Có sẵn kể từ Php 7.0.7.

Một mảng các phản hồi HTTP 200 sẽ được coi là phản hồi hợp lệ và không phải là lỗi.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 phải là một mảng cho các giá trị sau của tham số option:
Quyền muaĐặt
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
1 thành
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
37
Ghi chú Kết nối với một máy chủ và cổng cụ thể thay vì máy chủ và cổng của URL. Chấp nhận một loạt các chuỗi với định dạng $handle03.
$handle25 Được thêm vào Curl 7.49.0. Có sẵn kể từ Php 7.0.7. Một mảng các phản hồi HTTP 200 sẽ được coi là phản hồi hợp lệ và không phải là lỗi.
$handle26

Được thêm vào Curl 7.10.3.

Ghi chú::

Gọi lại chỉ được gọi khi tùy chọn option4 được đặt thành $handle7.option4 option is set to $handle7.

Trả về một giá trị khác không để hủy bỏ việc chuyển nhượng. Trong trường hợp đó, việc chuyển sẽ đặt lỗi $handle29.$handle29 error.

& nbsp;
Failed to connect() to host or proxy
02
Một cuộc gọi lại chấp nhận ba tham số. Đầu tiên là tài nguyên Curl, thứ hai là tài nguyên luồng được cung cấp để uốn cong thông qua tùy chọn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
08 và thứ ba là lượng dữ liệu tối đa cần đọc. Cuộc gọi lại phải trả về một chuỗi có độ dài bằng hoặc nhỏ hơn lượng dữ liệu được yêu cầu, thường bằng cách đọc nó từ tài nguyên luồng được truyền. Nó sẽ trả về một chuỗi trống cho tín hiệu $handle32.
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
08
, and the third is the maximum amount of data to be read. The callback must return a string with a length equal or smaller than the amount of data requested, typically by reading it from the passed stream resource. It should return an empty string to signal $handle32.
& nbsp;
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
38
Một cuộc gọi lại chấp nhận ba tham số. Đầu tiên là tài nguyên Curl, thứ hai là tài nguyên luồng được cung cấp để uốn cong thông qua tùy chọn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
08 và thứ ba là lượng dữ liệu tối đa cần đọc. Cuộc gọi lại phải trả về một chuỗi có độ dài bằng hoặc nhỏ hơn lượng dữ liệu được yêu cầu, thường bằng cách đọc nó từ tài nguyên luồng được truyền. Nó sẽ trả về một chuỗi trống cho tín hiệu $handle32.
& nbsp;
$handle34 Một cuộc gọi lại chấp nhận ba tham số. Đầu tiên là tài nguyên Curl, thứ hai là tài nguyên luồng được cung cấp để uốn cong thông qua tùy chọn
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
08 và thứ ba là lượng dữ liệu tối đa cần đọc. Cuộc gọi lại phải trả về một chuỗi có độ dài bằng hoặc nhỏ hơn lượng dữ liệu được yêu cầu, thường bằng cách đọc nó từ tài nguyên luồng được truyền. Nó sẽ trả về một chuỗi trống cho tín hiệu $handle32.$handle26 but is more modern and the preferred option from cURL.
Một cuộc gọi lại chấp nhận hai tham số. Đầu tiên là tài nguyên Curl và thứ hai là một chuỗi có dữ liệu được viết. Dữ liệu phải được lưu bởi cuộc gọi lại này. Nó phải trả về số lượng chính xác của byte được viết hoặc chuyển sẽ bị hủy bỏ với một lỗi.

Một cuộc gọi lại chấp nhận hai tham số. Có mục đích tương tự như $handle26 nhưng hiện đại hơn và tùy chọn ưa thích từ Curl.

Được thêm vào trong 7.32.0. Có sẵn kể từ Php 8.2.0. Các giá trị khác:
$handle37 Quyền muacurl_share_init(). Makes the cURL handle to use the data from the shared handle.

Đặt $latlng = "44.3585230889,8.57745766643"; $lang = "it"; $geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang"; $ch = curl_init($geocodeURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode == 200) { $geocode = json_decode($result); $location = $geocode->results[0]->address_components[0]->long_name; $city = $geocode->results[0]->address_components[1]->long_name; $province = $geocode->results[0]->address_components[2]->long_name; $region = $geocode->results[0]->address_components[3]->long_name; $country = $geocode->results[0]->address_components[4]->long_name; $geo_status = $geocode->status; $geo_str = "$location, $city, $province, $region, $country"; } else { $geo_status = "HTTP_FAIL_$httpCode"; $geo_str = "Failed: $geo_status"; } 1 thành

Kết quả của Curl_Share_init (). Làm cho tay cầm Curl để sử dụng dữ liệu từ tay cầm được chia sẻ.

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 on success or $handle7 on failure.

Trả về giá trị

Trả về
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
7 khi thành công hoặc $handle7 về thất bại.
Thay đổi
8.0.0 Phiên bảnCurlHandle instance now; previously, a resource was expected.
Sự mô tả handle mong đợi một trường hợp curlhandle bây giờ; Trước đây, một tài nguyên đã được dự kiến.$value6.
7.3.0 7.3.15, 7.4.3
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
61
, handle5, phpinfo()22, phpinfo()29, phpinfo()30, phpinfo()31, phpinfo()32, phpinfo()34, phpinfo()35, phpinfo()36, phpinfo()38, phpinfo()33, phpinfo()42,
Failed to connect() to host or proxy
84
,
Failed to connect() to host or proxy
88
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
25
,
Failed to connect() to host or proxy
96
, phpinfo()44, phpinfo()45, phpinfo()46,
Failed to connect() to host or proxy
49
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
35
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
0
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
2
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
64
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
4
, phpinfo()39,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
6
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
38
and phpinfo()88.
7.0.7 Giới thiệu $value6.$handle72,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
88
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
87
, $handle75, $handle76, $handle77, $handle78, $handle79, $handle80, $handle81, $handle82, $handle83, $handle84, $handle85, $handle86,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
73
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
70
, $handle89, $handle90, $handle91, $handle92, $handle93, $handle02,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
87
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
88
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
89
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
90
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
63
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
69
, phpinfo()11, option9, phpinfo()13,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
01
, phpinfo()28,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
12
, phpinfo()61,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
14
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
16
, phpinfo()2,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
23
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
10
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
40
,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
42
,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
62
, phpinfo()98, $option18, $option19, $option20, $option21 and
Failed to connect() to host or proxy
61
.

Introduced $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
"; 61, handle5, phpinfo()22, phpinfo()29, phpinfo()30, phpinfo()31, phpinfo()32, phpinfo()34, phpinfo()35, phpinfo()36, phpinfo()38, phpinfo()33, phpinfo()42, Failed to connect() to host or proxy 84, Failed to connect() to host or proxy 88, $latlng = "44.3585230889,8.57745766643"; $lang = "it"; $geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang"; $ch = curl_init($geocodeURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode == 200) { $geocode = json_decode($result); $location = $geocode->results[0]->address_components[0]->long_name; $city = $geocode->results[0]->address_components[1]->long_name; $province = $geocode->results[0]->address_components[2]->long_name; $region = $geocode->results[0]->address_components[3]->long_name; $country = $geocode->results[0]->address_components[4]->long_name; $geo_status = $geocode->status; $geo_str = "$location, $city, $province, $region, $country"; } else { $geo_status = "HTTP_FAIL_$httpCode"; $geo_str = "Failed: $geo_status"; } 25, Failed to connect() to host or proxy 96, phpinfo()44, phpinfo()45, phpinfo()46, Failed to connect() to host or proxy 49, $latlng = "44.3585230889,8.57745766643"; $lang = "it"; $geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang"; $ch = curl_init($geocodeURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode == 200) { $geocode = json_decode($result); $location = $geocode->results[0]->address_components[0]->long_name; $city = $geocode->results[0]->address_components[1]->long_name; $province = $geocode->results[0]->address_components[2]->long_name; $region = $geocode->results[0]->address_components[3]->long_name; $country = $geocode->results[0]->address_components[4]->long_name; $geo_status = $geocode->status; $geo_str = "$location, $city, $province, $region, $country"; } else { $geo_status = "HTTP_FAIL_$httpCode"; $geo_str = "Failed: $geo_status"; } 35, $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
"; 0, $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
"; 2, $latlng = "44.3585230889,8.57745766643"; $lang = "it"; $geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang"; $ch = curl_init($geocodeURL); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $result = curl_exec($ch); $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); curl_close($ch); if ($httpCode == 200) { $geocode = json_decode($result); $location = $geocode->results[0]->address_components[0]->long_name; $city = $geocode->results[0]->address_components[1]->long_name; $province = $geocode->results[0]->address_components[2]->long_name; $region = $geocode->results[0]->address_components[3]->long_name; $country = $geocode->results[0]->address_components[4]->long_name; $geo_status = $geocode->status; $geo_str = "$location, $city, $province, $region, $country"; } else { $geo_status = "HTTP_FAIL_$httpCode"; $geo_str = "Failed: $geo_status"; } 64 , $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
"; 4, phpinfo()39, $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
"; 6, $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $params); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $output = curl_exec($ch); echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
"; 38 và phpinfo()88.

Introduced $handle72,

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
88,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
87, $handle75, $handle76, $handle77, $handle78, $handle79, $handle80, $handle81, $handle82, $handle83, $handle84, $handle85, $handle86,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
73,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
70, $handle89, $handle90, $handle91, $handle92, $handle93, $handle02,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
87,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
88 ,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
89,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
90,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
63,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
69, phpinfo()11, option9, phpinfo()13,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
01, phpinfo()28,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
72,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
12, phpinfo()61,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
14,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
16, phpinfo()2,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
23,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
10,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
40,
$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
42,
$ch = curl_init(); 
curl_setopt($ch, CURLOPT_URL, $url); 
curl_setopt($ch, CURLOPT_POST, 1); 
curl_setopt($ch, CURLOPT_POSTFIELDS, $params); 
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); 
$output = curl_exec($ch); 
echo "Error = " . curl_errno($ch) . "
"; curl_close($ch); echo "Output = " . $output . "
";
62, phpinfo()98, $option18, $option19, $option20, $option21 và
Failed to connect() to host or proxy
61.

$option23

Ví dụ

Ghi chú::

Ví dụ #1 Khởi tạo phiên Curl mới và tìm nạp trang web

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
33 will encode the data as multipart/form-data, while passing a URL-encoded string will encode the data as application/x-www-form-urlencoded.

Ghi chú

  • Chuyển một mảng cho
    $latlng = "44.3585230889,8.57745766643";
    $lang = "it";
    $geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";
    
    $ch = curl_init($geocodeURL);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    $result = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);
    
    if ($httpCode == 200) {
        $geocode = json_decode($result);
    
        $location   = $geocode->results[0]->address_components[0]->long_name;
        $city       = $geocode->results[0]->address_components[1]->long_name; 
        $province   = $geocode->results[0]->address_components[2]->long_name; 
        $region     = $geocode->results[0]->address_components[3]->long_name;
        $country    = $geocode->results[0]->address_components[4]->long_name;
    
        $geo_status = $geocode->status;     
        $geo_str    = "$location, $city, $province, $region, $country";
    } else {
        $geo_status = "HTTP_FAIL_$httpCode";
        $geo_str    = "Failed: $geo_status";
    }
    
    33 sẽ mã hóa dữ liệu dưới dạng dữ liệu đa dạng/hình thức, trong khi truyền một chuỗi được mã hóa URL sẽ mã hóa dữ liệu dưới dạng ứng dụng/X-www-form-urlencoded.
  • Xem thêm
  • curl_setopt_array () - Đặt nhiều tùy chọn cho việc chuyển curl

Curlfile

CurlStringFile

$option25

$option26

$option27

$option28

$option29

$option30

rmckay tại WebAware dot com dot au ¶

10 năm trước

$option31

$option32

$option33

$option34

$option35

$option36

$option37

$option38

$option39

$option40

$option41

$option42

$option43

$option44

$option45

$option46

$option47

$option48

$option49

$option50

$option51

$option52

$option30

Joey ¶

6 năm trước

$option54

$option55

$option56

$option57

$option30

Philippe Dot Jausions tại 11abacus dot com ¶

16 năm trước

$option59

$option60

$option61

$option62

$option63

$option64

$option65

$option66

Steve Kamerman ¶

11 năm trước

$option67

$option68

$option69

$option70

$option71

Jscott jscott401 tại gmail dot com ¶

12 năm trước

$option72

$option73

$option74

$option30

ASHW1 - AT - KHÔNG SPAM - POST - DOT - CZ ¶

11 năm trước

$option76

$option77

$option78

$option79

$option80

Jscott jscott401 tại gmail dot com ¶

12 năm trước

$option81

$option82

$option30

ASHW1 - AT - KHÔNG SPAM - POST - DOT - CZ ¶

15 năm trước

$option84

$option85

$option30

Ed Cradock ¶

CurlStringFile

$option87

$option88

$option89

$option30

rmckay tại WebAware dot com dot au ¶

10 năm trước

$option91

$option92

$option93

Joey ¶

6 năm trước

Philippe Dot Jausions tại 11abacus dot com ¶

$option95

$option96

$option30

16 năm trước

10 năm trước

$option98

Joey ¶

6 năm trước

$option99

$value00

$value01

$value02

$value03

$value04

$option30

Philippe Dot Jausions tại 11abacus dot com ¶

16 năm trước

$value06

$value07

$value08

$option30

Steve Kamerman ¶

11 năm trước

$value10

$value11

$value12

$value13

$option30

Anderseta tại Gmail Dot Com ¶

12 năm trước

$value15

$value16

$value17

$value18

Jade Dot Skagss tại Gmail Dot Com ¶

14 năm trước

$value19

$value20

$value21

$value22

Tyranoweb ¶

13 năm trước

$value23

$value24

$value25

$value26

$value27

Aaron Wells ¶

7 năm trước

$value28

$value29

$value30

$value31

$option30

Badman ¶

8 năm trước

$value33

$value34

$value35

$value36

$value37

$value38

$value39

$value40

$value41

$option30

fnjordy tại gmail dot com

13 năm trước

$value43

$value44

$value45

$option30

Aaron Wells ¶

7 năm trước

$value47

$value48

$option30

Badman ¶

8 năm trước

$value50

$value51

$option30

fnjordy tại gmail dot com

Skyogre __at__ yandex __dot__ ru ¶

$value53

$value54

$option30

16 năm trước

Skyogre __at__ yandex __dot__ ru ¶

$value56

16 năm trước

13 năm trước

$value57

$value58

$value59

$option30

Aaron Wells ¶

8 năm trước

$value61

$value62

$option30

fnjordy tại gmail dot com

Skyogre __at__ yandex __dot__ ru ¶

$value64

16 năm trước

Skyogre __at__ yandex __dot__ ru ¶

$value65

$value66

$value67

$value68

$value69

$value70

$value71

$value72

$value73

$value74

$value75

$option30

16 năm trước

12 năm trước

$value77

Juozaspo tại Gmail Dot Com ¶

7 năm trước

$value78

$value79

$value80

$value81

$value82

$value83

$value84

$option30

Badman ¶

7 năm trước

$value86

$value87

$option30

Badman ¶

8 năm trước

$value89

$value90

$option30

fnjordy tại gmail dot com

8 năm trước

$value92

$value93

$value94

$value95

$value96

$value97

$value98

$option30

fnjordy tại gmail dot com

Skyogre __at__ yandex __dot__ ru ¶

handle00

16 năm trước

8 năm trước

handle01

handle02

handle03

handle04

handle05

handle06

handle07

$option30

fnjordy tại gmail dot com

Skyogre __at__ yandex __dot__ ru ¶

handle09

16 năm trước

Skyogre __at__ yandex __dot__ ru ¶

handle10

handle11

$option30

16 năm trước

Juozaspo tại Gmail Dot Com ¶

handle13

handle14

handle15

handle16

handle17

10 năm trước

Skyogre __at__ yandex __dot__ ru ¶

handle18

handle19

$option30

16 năm trước

14 năm trước

handle21

handle22

handle23

$option30

Juozaspo tại Gmail Dot Com ¶

8 năm trước

handle25

fnjordy tại gmail dot com

Skyogre __at__ yandex __dot__ ru ¶

handle26

handle27

handle28

handle29

handle30

$option30

16 năm trước

14 năm trước

handle32

handle33

handle34

$option30

Juozaspo tại Gmail Dot Com ¶

12 năm trước

handle36

handle37

handle38

handle39

10 năm trước

13 năm trước

handle40

S \

8 năm trước

handle41

fnjordy tại gmail dot com

13 năm trước

handle42

handle43

$option30

Skyogre __at__ yandex __dot__ ru ¶

16 năm trước

handle45

Juozaspo tại Gmail Dot Com ¶

10 năm trước

handle46

S \

13 năm trước

handle47

handle48

handle49

handle50

11 năm trước

14 năm trước

handle51

handle52

$option30

PHP tại rhaworth dot net ¶

7 năm trước

handle54

handle55

$option30

Badman ¶

8 năm trước

handle57

handle58

$option30

fnjordy tại gmail dot com

Juozaspo tại Gmail Dot Com ¶

handle60

handle61

handle62

10 năm trước

8 năm trước

handle63

handle64

handle65

handle66

handle67

handle68

handle69

$option30

fnjordy tại gmail dot com

8 năm trước

handle71

handle72

$option77

handle74

$option30

fnjordy tại gmail dot com

Skyogre __at__ yandex __dot__ ru ¶

handle76

handle77

$option30

16 năm trước

Juozaspo tại Gmail Dot Com ¶

handle79

handle37

handle81

handle82

10 năm trước

8 năm trước

handle83

handle84

handle85

handle86

handle87

handle88

$option30

fnjordy tại gmail dot com

7 năm trước

handle90

handle91

handle92

handle48

handle94

handle95

Badman ¶

12 năm trước

handle96

handle97

handle98

$option30

8 năm trước

8 năm trước

option00

option01

option02

option03

$option30

fnjordy tại gmail dot com

Juozaspo tại Gmail Dot Com ¶

option05

option06

option07

$option30

10 năm trước

13 năm trước

option09

option10

$option30

S \

14 năm trước

option12

option13

$option30

11 năm trước

Juozaspo tại Gmail Dot Com ¶

option15

option16

$option30

10 năm trước

14 năm trước

option18

option19

$option30

S \

8 năm trước

option21

option22

option23

option24

option25

$option30

fnjordy tại gmail dot com

Skyogre __at__ yandex __dot__ ru ¶

option27

option28

option29

option30

option31

option32

option33

option34

option35

option36

option37

option38

option39

option40

option41

$option30

16 năm trước

Juozaspo tại Gmail Dot Com ¶

option43

option44

option45

option46

option47

option48

Adrian tại Foeder Dot de ¶

10 năm trước

option49

option50

option51

option52

$option30

Ericbianchetti tại Gmail Dot Com ¶

13 năm trước

option54

option55

option56

$option30

Simbiat tại Outlook Dot Com ¶

25 ngày trước

option58

QWERTZ182 ¶

2 năm trước

option59

option60

option61

option62

option63

Julien Veneziano ¶

12 năm trước

option64

option65

$option30

nabikaz tại gmail dot com ¶

5 năm trước

option67

Bash tại Noemailaddress dot com

4 năm trước

option68

option69

$option30

Mikko Dot Rantalainen tại Peda Dot Net

6 năm trước

option71

Steve tại WebSmithery Dot Co Dot Uk ¶

5 năm trước

option72

option73

$option30

Bash tại Noemailaddress dot com

4 năm trước

option75

option76

option77

$option30

Mikko Dot Rantalainen tại Peda Dot Net

4 năm trước

option79

option80

$option30

Mikko Dot Rantalainen tại Peda Dot Net

4 năm trước

option82

option83

option84

$option30

Mikko Dot Rantalainen tại Peda Dot Net

6 năm trước

option86

option87

option88

option89

option90

option91

Steve tại WebSmithery Dot Co Dot Uk ¶

10 năm trước

option92

Lachlan tại Radelaide Dot Net

10 năm trước

option93

option94

$option30

8 năm trước

Joan ¶

option96

option97

option98

option99

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
000

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
001

$option30

Gandalf trắng ¶

12 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
003

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
004

$option30

nabikaz tại gmail dot com ¶

12 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
006

handle37

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
008

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
009

nabikaz tại gmail dot com ¶

12 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
010

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
011

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
012

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
013

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
014

nabikaz tại gmail dot com ¶

13 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
015

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
016

$option30

5 năm trước

Bash tại Noemailaddress dot com

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
018

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
019

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
020

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
021

$option30

4 năm trước

Mikko Dot Rantalainen tại Peda Dot Net

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
023

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
024

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
025

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
026

$option30

6 năm trước

10 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
028

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
029

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
030

$option30

Steve tại WebSmithery Dot Co Dot Uk ¶

Bash tại Noemailaddress dot com

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
032

4 năm trước

12 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
033

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
034

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
035

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
036

nabikaz tại gmail dot com ¶

13 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
037

5 năm trước

4 năm trước

$latlng = "44.3585230889,8.57745766643";
$lang = "it";
$geocodeURL = "http://maps.googleapis.com/maps/api/geocode/json?latlng=$latlng&sensor=false&language=$lang";

$ch = curl_init($geocodeURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode == 200) {
    $geocode = json_decode($result);

    $location   = $geocode->results[0]->address_components[0]->long_name;
    $city       = $geocode->results[0]->address_components[1]->long_name; 
    $province   = $geocode->results[0]->address_components[2]->long_name; 
    $region     = $geocode->results[0]->address_components[3]->long_name;
    $country    = $geocode->results[0]->address_components[4]->long_name;

    $geo_status = $geocode->status;     
    $geo_str    = "$location, $city, $province, $region, $country";
} else {
    $geo_status = "HTTP_FAIL_$httpCode";
    $geo_str    = "Failed: $geo_status";
}
038

Curl có hoạt động trên localhost không?

Nó cũng hoạt động cho localhost, vì Curl sẽ kiểm tra bộ đệm trước khi giải quyết nội bộ và giải quyết -giải quyết lưu trữ bộ đệm DNS với các mục đã cho.(Được cung cấp cho các ứng dụng thông qua tùy chọn Curlopt_Resolve.), since curl will check the cache before the internal resolve and --resolve populates the DNS cache with the given entries. (Provided to applications via the CURLOPT_RESOLVE option.)

Tôi có thể sử dụng Curl trong PHP không?

Việc sử dụng Curl trong PHP Curl là tiện ích mở rộng PHP cho phép bạn sử dụng cú pháp URL để nhận và gửi dữ liệu.Curl làm cho nó đơn giản để kết nối giữa các trang web và tên miền khác nhau.Có được một bản sao tài liệu của một trang web.Đệ trình các biểu mẫu tự động, xác thực và sử dụng cookie.cURL is a PHP extension that allows you to use the URL syntax to receive and submit data. cURL makes it simple to connect between various websites and domains. Obtaining a copy of a website's material. Submission of forms automatically, authentication and cookie use.