Created
April 10, 2014 18:04
-
-
Save kiang/10407661 to your computer and use it in GitHub Desktop.
為了把文章順利貼到 ptt 寫的小程式
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 | |
$fh = fopen('talk', 'r'); | |
while($line = fgets($fh)) { | |
if($line === "\n") continue; | |
$mbOffset = 0; | |
while($subLine = mb_strcut($line, $mbOffset, 100, 'utf-8')){ | |
$mbOffset += strlen($subLine); | |
echo $subLine . "\n"; | |
} | |
} | |
fclose($fh); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment