Report abuse

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?
// Скрипт сделал Сейшельский - http://seosey.ru. Переделки приветствуются. Комментарии можно оставить здесь - http://seosey.ru/2010/08/prostoj-skript-dlya-skloneniya-slov-po-padezham/

header('Content-Type: text/html ; charset="utf-8"');
$file = file_get_contents('file.txt'); 
$file = explode(chr(10), $file);
$delim = '|';

foreach ($file as $k => $v) {
	$url = "http://export.yandex.ru/inflect.xml?name=$v";
	$xml = simplexml_load_file($url);
	$original = $xml->original;
	$im = trim($xml->inflection[0]);
	$rod = trim($xml->inflection[1]);
	$dat = trim($xml->inflection[2]);
	$vin = trim($xml->inflection[3]);
	$tvor = trim($xml->inflection[4]);
	$predl = trim($xml->inflection[5]);

	echo $im.$delim.$rod.$delim.$dat.$delim.$vin.$delim.$tvor.$delim.$predl.chr(10);
	echo '<br />';
}
?>