cat test.txt
kim
byoungguk


cat rewind.php

<?
$fp = fopen("test.txt","r");
if(!$fp) {
        echo "fail";
        exit;
}

$str_before = fgets($fp,10000);
echo $str_before."\n";

rewind($fp);
$str_after = fgets($fp,10000);
echo $str_after."\n";
?>


php rewind.php

Content-type: text/html
X-Powered-By: PHP/4.3.9

kim

kim


신고

WRITTEN BY
김병국
유용했던 자료를 기록해 두었습니다. 도움이 되시길~~~ Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you fun

받은 트랙백이 없고 , 댓글이 없습니다.
secret