Last active
January 24, 2019 15:28
-
-
Save ZAYEC77/6217f63d3b87a587e4c531c54326a866 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function fixName($value) { | |
$value = mb_eregi_replace('й', 'й', $value); | |
$value = mb_eregi_replace('ё', 'ё', $value); | |
return $value; | |
} | |
function getDirs($path) { | |
return array_diff(scandir($path), array('..', '.')); | |
} | |
function mapFile($handle, $cb, $separator = '\n') { | |
while (!feof($handle)) { | |
//$buffer = fgets($handle); | |
$buffer = stream_get_line($fp, 65535, $separator); | |
yeild $cb($buffer); | |
} | |
fclose($handle); | |
} | |
$input = 'input.txt'; | |
$output = 'output.txt'; | |
$inputHandle = fopen($input, 'r'); | |
$outputHandle = fopen($input, 'w'); | |
fclose($inputHandle); | |
fclose($outputHandle); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment