PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

gzgetss> <gzgetc
Last updated: Sun, 25 Nov 2007

view this page in

gzgets

(PHP 4, PHP 5)

gzgets — 지정된 파일로 부터 라인을 읽어 들인다.

Description

string gzgets ( int $zp , int $length )

fp에 의해 지정된 파일로부터 length - 1 bytes의 문장을 리턴한다. length - 1 bytes를 읽거나, 새로운 라인을 만나거나, EOF의 경우 (혹 처음으로 돌아가든지), 읽는것을 그만둔다.

에러가 일어난 경우 FALSE를 반환한다.

파일의 지정은 정확해야 하고, gzopen()에 의해 성공적으로 열린 파일이어야 한다.

참고 gzopen(), gzgetc(), fgets().



add a note add a note User Contributed Notes
gzgets
04-Aug-2005 11:21
For the above example by VIJAY, using gzgetc would be better, as I've encountered binary/text file incompatibilities (at least with PHP 4.0.4).
prismngp1 at yahoo dot com
10-Aug-2002 05:19
<?
// this is simple code by VIJAY to unzip .gz file
$file = "/absolute/path/to/your/file" ;
$fp = fopen("$file", "w") ;
// file to be unzipped on your server
$filename = "filename.gz" ;
$zp = gzopen($filename, "r");

if ($zp)
{
  while (!gzeof($zp))
  {
    $buff1 = gzgets ($zp, 4096) ;
    fputs($fp, $buff1) ;
  }               
}           
gzclose($zp) ;
fclose($fp) ;
?>

gzgetss> <gzgetc
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites