П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3513 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 6118 раз(а).

Учебник HTML.
Просмотров 3272 раз(а).

Руководство по PHP5.
Просмотров 5492 раз(а).

Хостинг через призму DNS.
Просмотров 4134 раз(а).

Подборка текстов стандартных документов.
Просмотров 55769 раз(а).

Учебник PHP - Самоучитель
Просмотров 3086 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 5655 раз(а).

Внешние атаки...
Просмотров 3836 раз(а).

Учебник PHP.
Просмотров 2822 раз(а).

SSI в примерах.
Просмотров 37459 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. Глава 44. Streams API for PHP Extension Authors След.

Streams Basics

Using streams is very much like using ANSI stdio functions. The main difference is in how you obtain the stream handle to begin with. In most cases, you will use php_stream_open_wrapper() to obtain the stream handle. This function works very much like fopen, as can be seen from the example below:

Пример 44-1. simple stream example that displays the PHP home page

php_stream * stream = php_stream_open_wrapper("http://www.php.net", "rb", REPORT_ERRORS, NULL);
if (stream) {
while(!php_stream_eof(stream)) {
char buf[1024];

if (php_stream_gets(stream, buf, sizeof(buf))) {
printf(buf);
} else {
break;
}
}
php_stream_close(stream);
}

The table below shows the Streams equivalents of the more common ANSI stdio functions. Unless noted otherwise, the semantics of the functions are identical.

Таблица 44-1. ANSI stdio equivalent functions in the Streams API

ANSI Stdio FunctionPHP Streams FunctionNotes
fopenphp_stream_open_wrapperStreams includes additional parameters
fclosephp_stream_close 
fgetsphp_stream_gets 
freadphp_stream_readThe nmemb parameter is assumed to have a value of 1, so the prototype looks more like read(2)
fwritephp_stream_writeThe nmemb parameter is assumed to have a value of 1, so the prototype looks more like write(2)
fseekphp_stream_seek 
ftellphp_stream_tell 
rewindphp_stream_rewind 
feofphp_stream_eof 
fgetcphp_stream_getc 
fputcphp_stream_putc 
fflushphp_stream_flush 
putsphp_stream_putsSame semantics as puts, NOT fputs
fstatphp_stream_statStreams has a richer stat structure


Пред. Начало След.
Streams API for PHP Extension Authors Уровень выше Streams as Resources


Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru