-
-
Save virusvn/5de5e0942d2aa9b191bb 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 | |
public function convert_usable_format($file){ | |
$buf = mb_convert_encoding(file_get_contents($file), "UTF-8", "SJIS-WIN"); | |
$buf = str_replace(array("\r\n", "\n", "\r"), "m9(^v^)", $buf); | |
$buf = str_replace("m9(^v^)", "\r\n", $buf); | |
$handle = tmpfile(); | |
fwrite($handle, $buf); | |
rewind($handle); | |
return $handle; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment