Guest User

Untitled

a guest
Oct 22nd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.41 KB | None | 0 0
  1. <?php
  2.  
  3. $string_to_xml = file_get_contents('/home/u/phpDev/simple/home/parser/www/ya.xml', FILE_USE_INCLUDE_PATH);
  4. $xml = simplexml_load_string($string_to_xml);
  5.  
  6. $i = 0;
  7. foreach($xml->response->results->grouping->group as $a) {
  8.     echo $a->doc->domain . "\n";
  9.     if(preg_match("~sowich\.info~is", $a->doc->domain) == 1) {
  10.         echo '`сайт найден на позиции' . $i;
  11.         break;
  12.     }
  13.     $i++;
  14. }
Add Comment
Please, Sign In to add comment