| Recommend this page to a friend! | 
|  Download | 
| Info | Example |  Files |  Install with Composer |  Download | Reputation | Support forum | Blog | Links | 
| Ratings | Unique User Downloads | Download Rankings | ||||
| Not yet rated by the users | Total: 88 This week: 1 | All time:  9,993 This week: 42  | ||||
| Version | License | PHP version | Categories | |||
| sdatas 1.0 | The PHP License | 5 | HTTP, PHP 5 | 
| Description | Author | ||||||||||||||||||||||
| This class can send HTTP requests to different Web servers. | 
 | ||||||||||||||||||||||
| 
<?php
 | 
PHP cURL : Sdata modules multi threading
GET DATA
$url 	= array(); 
for ($i=0; $i <12; $i++) { 
$url[] = array(
	'url' => 'http://exapme.com',
	'note' => 'optional', 
);
} $result = $sdata->sdata($url);
print_r($result);
* POST DATA
$url = array(); for ($i=0; $i <12; $i++) { $custom[] = array(
'header' => array(
    "accept: application/json",
    "content-type: application/json",
),
'post' => '{"emailAddress":"[email protected]"}'
);
$url[] = array(
	'url' => 'http://example.com/post',
	'note' => 'optional', 
);
} $result = $sdata->sdata($url , $custom);
print_r($result);
* Use Proxy
$url = array();
$proxy = array( 'ip' => '127.0.0.1', 'port' => '80' );
for ($i=0; $i <12; $i++) { $custom[] = array(
'header' => array(
    "accept: application/json",
    "content-type: application/json",
),
'proxy' => $proxy,
'post' => '{"emailAddress":"[email protected]"}'
);
$url[] = array(
	'url' => 'http://exapme.com',
	'note' => 'optional', 
);
} $result = $sdata->sdata($url);
print_r($result);
* Remove cookies files
$url = array(); for ($i=0; $i <12; $i++) {
$url[] = array(
	'url' => 'http://exapme.com',
	'note' => 'optional', 
);
} $result = $sdata->sdata($url);
print_r($result);
$sdata->session_remove($result);
* Set proxy with hostname 
$ProxyRotation['proxy'] = array(
'auth' => array(
	'hostname' 	=> 'http://proxy.xxxx.com',
	'port' 		=> '1222',
	'username' 	=> 'auto', 
	'password' 	=> 'jmtP4ty8LoS2jJoAJXwKGaw5M', 
),
); $sdata->setRules($ProxyRotation);
* Set Rotation proxy using rules
$ProxyRotation['proxy'] = array(
'file' => 'proxy.txt',
'rules' => array(
	'respons' 	=> array('text' =>  'city'), 
	'http_code' => array('text' =>  0), 
), 
);
$sdata->setRules($ProxyRotation);
* example : Rotation proxy using rules
<?php require_once("sdata-modules.php"); / * @Author: Eka Syahwan * @Date: 2017-12-11 17:01:26 * @Last Modified by: Nokia 1337 * @Last Modified time: 2019-08-17 01:44:33 */
$ProxyRotation['proxy'] = array(
'file' => 'proxy.txt',
'rules' => array(
	'respons' 	=> array('text' =>  'city'), 
	'http_code' => array('text' =>  0), 
), 
);
$sdata->setRules($ProxyRotation);
while (TRUE) {
$url[] = array(
	'url' => 'http://ip-api.com/json/',
	'note' => $emailnya, 
);
$res = $sdata->sdata($url);unset($url);
foreach ($res as $key => $value) {
	print_r($value);
	$json = json_decode($value[respons],true);
	echo $json['query']."\r\n";
}
}
* Format proxy non auth: 
127.0.0.1:1223
* Format proxy with auth: 
172.241.117.58:29842:bhyl:0jDYgVHn
## Copyright and license
Code and documentation copyright 2017 the Eka Syahwan (Sdata author) Code released under the MIT License. Docs released under Creative Commons.
|  Files (3) | 
| File | Role | Description | 
|---|---|---|
|    example-get.php | Example | Example script | 
|    README.md | Doc. | Read me | 
|  sdata-modules.php | Class | Class source | 
| The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. | 
|  Install with Composer | 
| Version Control | Unique User Downloads | Download Rankings | |||||||||||||||
| 100% | 
 | 
 | 
| Applications that use this package | 
 If you know an application of this package, send a message to the author to add a link here.
 If you know an application of this package, send a message to the author to add a link here.