资 源 简 介
Curlx
Curlx is a PHP5 wrapper class for cURL functions.
Examples
Simplified GET request (to fetch a web page, similar to file_get_contents())
$curlx = new Curlx;$web_page = $curlx->fetch("http://example.com/");
Simplified POST request
$curlx = new Curlx;$web_page = $curlx->fetch("http://example.com/", array("username" => "User", "password" => "pa55word"));
Site login
```
// Imagine you"re using a social networking site on example.com,
// and you want your PHP script to log in and update your profile for you.
$curlx = new Curlx;
// This file will be used whenever there"s cookie data to be stored or sent to the server.
$curlx->cookie("my_cookie.text");
// Send a POST request containing your username and password to the login page
$response = $curlx->fetch("http://example.com/login", a