
20.03.2008, 22:43
|
|
Познающий
Регистрация: 14.02.2008
Сообщений: 46
Провел на форуме: 189430
Репутация:
12
|
|
PHP код:
<?php
function rewrites($fn,$str)
{
if(file_exists($fn)):
$f=fopen($fn,w);
for($i=0;$i<=sizeof($str)-1;$i++):
echo '-> '.$str[$i].'<br>';
fwrite($f,$str[$i]."\n");
endfor;
fclose($f);
else: die('not found: <b>'.$fn); endif;
}
$list=file('list.dat');
for($i=0;$i<sizeof($list);$i++)
$massresult[]= str_replace(chr(13), "",chop(preg_replace('~([^\s]+) l:([^\s]+) p:([^\n]+)~', '\\2:\\3@\\1', $list[$i])));
rewrites('newlist.dat',$massresult);
?>
Последний раз редактировалось WVBR; 21.03.2008 в 00:23..
|
|
|