Comment detail

条件を満たす行を取り除く (Nested Flatten)
stream_get_lineバージョン
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
<?php

$handle = fopen("odai10.txt", "r");
while(!feof($handle))
{
    $buffer = stream_get_line($handle, 4096, "\n");
    if(strpos($buffer, "#") !== 0 )
    {
        $array[] = $buffer;
    }
}
fclose($handle);
file_put_contents("odai10.txt", implode("\n", $array));
?>

Index

Feed

Other

Link

Pathtraq

loading...