Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $k = microtime(1);
- $url = "http://www.part-kom.ru/engine/api/v2/search/parts";
- $array = json_decode('{"number":"4PK875","brand_id":"710","find_substitutes":0,"store":0}');
- $username = "eezap.ru";
- $password = "**********"; //наш пароль
- $url .= "?" . http_build_query($array);
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_TIMEOUT, 30); //timeout after 30 seconds
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
- curl_setopt($ch, CURLOPT_USERPWD, "$username:$password");
- $result = curl_exec($ch);
- curl_close($ch);
- echo microtime(1)-$k; // 9 секунд
Add Comment
Please, Sign In to add comment