Advertisement
Guest User

Untitled

a guest
Apr 1st, 2012
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.61 KB | None | 0 0
  1. <?
  2. header('Content-Type: text/html ; charset="utf-8"');
  3. $file = file_get_contents('file.txt');
  4. $file = explode(chr(10), $file);
  5. $delim = '|';
  6.  
  7. foreach ($file as $k => $v) {
  8.     $url = "http://export.yandex.ru/inflect.xml?name=$v";
  9.     $xml = simplexml_load_file($url);
  10.     $original = $xml->original;
  11.     $im = trim($xml->inflection[0]);
  12.     $rod = trim($xml->inflection[1]);
  13.     $dat = trim($xml->inflection[2]);
  14.     $vin = trim($xml->inflection[3]);
  15.     $tvor = trim($xml->inflection[4]);
  16.     $predl = trim($xml->inflection[5]);
  17.  
  18.     echo $im.$delim.$rod.$delim.$dat.$delim.$vin.$delim.$tvor.$delim.$predl.chr(10);
  19.     echo '<br />';
  20. }
  21. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement