php params array query host jeck ru host www jeck ru region ch curl_in

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
<?php
$params = array(
'query' => 'host:jeck.ru | host:www.jeck.ru',
'region' => 0
);
$ch = curl_init('http://api.pr-cy.ru/realtime/yandex/xml?' . http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Api-Key: L.);^3sK<a?;E2.M'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = json_decode(curl_exec($ch));
var_dump($json);