title: Query data using curl
body: <p>Why is it not working code, why - I do not understand. Code gets a response from curl and looking (must look) in this response word yes, if it is found - that displays the text - if not, then the other. The code:</p>
  
  <pre><code>    &lt;?PHP 
  // CURL
  $ch = curl_init('http://dev.local/phpwhois-4.2.2/example.php?query=domain.ru&amp;output=object');
  curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/5.0");
  curl_setopt  ($ch, CURLOPT_HEADER, false);
  $curl = curl_exec($ch); 
  echo $curl;
  curl_close($ch);
  
  if(preg_match('~\s*yes\s*~u', $curl))
    echo 'Ok';
  else
    echo 'Else text';
  ?&gt;
  </code></pre>
  
  <p>Error strange, more precisely, its not quite there, but - if curl sends text yes, that does not work, then writes that else, and if it does not give a text - too else. If all the text that simply gives curl himself put in the variable it works. </p>
  
  <p>That's what gives the script to curl `e (this answer in writing what else):</p>
  
  <blockquote>
    <p>regrinfo->Array disclaimer->Array 0->By submitting a query to RIPN's
    Whois Service 1->you agree to abide by the following terms of use:
    2->#3.2 (in Russian)
    3-#3.2 (in English).
    domain->Array name->hashcode.ru nserver->Array 
    ns1.nameself.com->81.176.95.18  ns2.nameself.com->88.212.207.45
    status->REGISTERED, DELEGATED, VERIFIED created->2010-11-05
    expires->2014-11-05 source->TCI <strong>registered->yes</strong> regyinfo->Array
    referrer-> registrar->RUCENTER-REG-RIPN
    servers->Array 0->Array  server->ru.whois-servers.net 
    args->hashcode.ru port->43 type->domain rawdata->Array 0->% By
    submitting a query to RIPN's Whois Service 1->% you agree to abide by
    the following terms of use: 2->%
     (in Russian) 3->%
     (in English). 4->
    5->domain:   6->nserver:  . 7->nserver: 
    . 8->state:  REGISTERED, DELEGATED, VERIFIED
    9->person: Private Person 10->registrar: REGTIME-REG-RIPN
    11->admin-contact:  12->created: 2010.11.05
    13->paid-till: 2014.11.05 14->free-date: 2014.12.06 15->source: TCI
    16-> 17->Last updated on 2014.07.27 12:31:31 MSK 18-></p>
  </blockquote>