|
użytkowników online: 50
|
OPINIE UŻYTKOWNIKÓW
|
Na początku, kiedy zobaczyłem, że ktoś chce jakiejś opłaty za pomoc w tworzeniu stron ryknąłem śmiechem - potem przyszły problemy... i zaryzykowałem. Druga rzecz to: nie chciałem "kopiować". Ale prawda jest taka: są lepsi, bardziej doświadczeni i... czasem trzeba poprosić o pomoc, a jak poświęca się na to trzecią cześć życia, to nic dziwnego, że nie chce się swoich "sekretów" zdradzać za darmo. Skorzystałem z "algorytmy.pl" i naprawdę jestem z tego w 100% zadowolony, polecam - dla zawodowców (co się uczą) i amatorów (można skorzystać z gotowego rozwiązania).
Tomasz Czypicki
Cybernoxa
|
|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
gzopen (PHP 3, PHP 4, PHP 5) gzopen -- Open gz-file Opisresource gzopen ( string filename, string mode [, int use_include_path] )
Opens a gzip (.gz) file for reading or writing.
gzopen() can be used to read a file which is
not in gzip format; in this case gzread() will
directly read from the file without decompression.
Parametry
- filename
The file name.
- mode
As in fopen() (rb or
wb) but can also include a compression level
(wb9) or a strategy: f for
filtered data as in wb6f, h for
Huffman only compression as in wb1h.
(See the description of deflateInit2 in zlib.h for
more information about the strategy parameter.)
- use_include_path
You can set this optional parameter to 1, if you
want to search for the file in the include_path too.
Zwracane wartości
Returns a file pointer to the file opened, after that, everything you read
from this file descriptor will be transparently decompressed and what you
write gets compressed.
If the open fails, the function returns FALSE.
Przykłady
Przykład 1. gzopen() Example |
<?php
$fp = gzopen("/tmp/file.gz", "r");
?>
|
|
User Contributed Notesrob at digital-crocus dot com
01-Jun-2005 02:28
dtorop932 at hotmail dot com's comments, according to my tests, is incorrect. That code wishes to download the entire file before parsing, which is inconvinient. The wget method works though.
pentek_imre at mailbox dot hu
29-Jan-2005 07:36
Be aware that when opening a remote file on a http server the gzopen will return by default false after 120 seconds waiting to any answer.
dtorop932 at hotmail dot com
21-Oct-2004 09:04
RE dubious's comment: "Being able to read gzip streams from ftp and http is near the top of my personal wishlist at the moment..."
One way to read a gzip stream over http is to daisychain stream wrappers, e.g.:
<?
$fp = fopen("compress.zlib://http://some.website.org/example.gz", "r");
?>
-delete-this-part-dubious at 2xtreme dot net
03-Jan-2002 04:22
"On the fly" gunzipping actually DOES seem to work - it just appears that only LOCAL streams/files (including php://stdin) can be accessed for some reason. I THINK (but have not yet tested) that you could similarly gzopen "php://stdout" and pass a stream of gzipped data to the browser (when run from a web page) or console (when run standalone) through there.
I HAVE tested scripts from the command line like:
wget -q -O- ftp://some.host.net/pub/some_gzip_file.gz | php gunzip_stuff.php
where gunzip_stuff.php would be a script that gzopened "php://stdin" and did gzgets from that stream, and it seems to work fine, but that obviously doesn't help someone wanting to grab gzipped streams from remote sites from a web-based script.
Being able to read gzip streams from ftp and http is near the top of my personal wishlist at the moment...
|