Skip to content

Instantly share code, notes, and snippets.

@kiang
Created April 10, 2014 18:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiang/10407661 to your computer and use it in GitHub Desktop.
Save kiang/10407661 to your computer and use it in GitHub Desktop.
為了把文章順利貼到 ptt 寫的小程式
<?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