PHP-Fusion
v.7.01
AP-Fusion
v7.02.05
Pimped-Fusion-AP
v0.09.03
March 19 2024 13:59:34
Авторизация
Логин

Пароль



Вы не зарегистрированы?
Нажмите здесь для регистрации.

Забыли пароль?
Запросите новый здесь.
Мини-чат
Вы должны авторизироваться, чтобы добавить сообщение.

lom
06/04/2018 14:03
Мы рады, ждем девятку. Очень хочется пощупать

Alipapa
27/03/2018 22:16
Всем привет, все неисправности устранили, всё у нас работает

mukaton
30/10/2015 02:37
Не получается ничего скачать. Ошибка Not Found

Alipapa
06/10/2015 23:00
9-я версия php-fusion на подходе, следите за новостями

Alipapa
10/11/2014 11:24
Заметь, я дважды ответил через 3 минуты после вопроса, могли бы уже решить

Последние статьи
· О стабилизаторах нап...
· СМС и Вебмани
· TinyMCE для пользова...
· PCRE (Perl Compatibl...
· PCRE (Perl Compatibl...
Последние активные темы форума
  Темы Просмотров Ответов Последние сообщения
PHP-Fusion 7 Bogatyr - бесп...
Моды, плагины
7094 1 Vveb--ws
08-10-2018 16:47
Php-Fusion v9. Первые впеча...
Вопросы по работе
4456 3 Vveb--ws
25-07-2018 13:46
Появился хэлп по PHP-Fusion...
Вопросы по работе
6696 7 Vveb--ws
25-07-2018 13:42
prestashop&ap-fusion
Вопросы по работе
17286 61 Alipapa
26-08-2014 10:29
Плагин магазина Ap-Shop
Моды, плагины
14516 70 Alipapa
18-08-2014 18:14
TinyMCE
Вопросы по работе
21046 55 Alipapa
27-07-2013 21:57
HTML-5
Моды, плагины
5411 1 Alipapa
15-06-2013 19:47
Мультиязычность в Pimped-Fu...
Ошибки, баги, глюки
6237 4 Papich
16-04-2013 12:39
Pimped-Fusion. Первые впеча...
Ошибки, баги, глюки
21576 127 Alipapa
18-12-2012 10:59
Ищу мод для расстановки код...
Моды, плагины
14957 55 Alipapa
17-09-2012 14:00
Как присоединить файл к лич...
Моды, плагины
8239 3 lom
27-05-2012 18:12
Что мне не нравится в после...
Вопросы по работе
6827 4 Alipapa
27-05-2012 18:08
Проблемы с добавлением кате...
Вопросы по работе
7707 5 Alipapa
27-05-2012 18:06

ob_start

(PHP 4 , PHP 5)

ob_start -- Turn on output buffering

Description

bool ob_start ( [callback output_callback [, int chunk_size [, bool erase]]] )

This function will turn output buffering on. While output buffering is active no output is sent from the script (other than headers), instead the output is stored in an internal buffer.

The contents of this internal buffer may be copied into a string variable using ob_get_contents(). To output what is stored in the internal buffer, use ob_end_flush(). Alternatively, ob_end_clean() will silently discard the buffer contents.

An optional output_callback function may be specified. This function takes a string as a parameter and should return a string. The function will be called when ob_end_flush() is called, or when the output buffer is flushed to the browser at the end of the request. When output_callback is called, it will receive the contents of the output buffer as its parameter and is expected to return a new output buffer as a result, which will be sent to the browser. If the output_callback is not a callable function, this function will return FALSE. If the callback function has two parameters, the second parameter is filled with a bit-field consisting of PHP_OUTPUT_HANDLER_START, PHP_OUTPUT_HANDLER_CONT and PHP_OUTPUT_HANDLER_END.

Замечание: In PHP 4.0.4, ob_gzhandler() was introduced to facilitate sending gz-encoded data to web browsers that support compressed web pages. ob_gzhandler() determines what type of content encoding the browser will accept and will return its output accordingly.

Замечание: Before PHP 4.3.2 this function did not return FALSE in case the passed output_callback can not be executed.

Внимание

Some web servers (e.g. Apache) change the working directory of a script when calling the callback function. You can change it back by e.g. chdir(dirname($_SERVER['SCRIPT_FILENAME'])) in the callback function.

If the optional parameter chunk_size is passed, the callback function is called on every first newline after chunk_size bytes of output. The output_callback parameter may be bypassed by passing a NULL value.

If the optional parameter erase is set to FALSE, the buffer will not be deleted until the script finishes (as of PHP 4.3.0).

Output buffers are stackable, that is, you may call ob_start() while another ob_start() is active. Just make sure that you call ob_end_flush() the appropriate number of times. If multiple output callback functions are active, output is being filtered sequentially through each of them in nesting order.

ob_end_clean(), ob_end_flush(), ob_clean(), ob_flush() and ob_start() may not be called from a callback function. If you call them from callback function, the behavior is undefined. If you would like to delete the contents of a buffer, return "" (a null string) from callback function.

Пример 1. User defined callback function example

<?php

function callback ( $buffer )
{
  
// replace all the apples with oranges
  
return ( str_replace ( "apples" , "oranges" , $buffer ));
}

ob_start ( "callback" );

?>
<html>
<body>
<p>It's like comparing apples to oranges.</p>
</body>
</html>
<?php

ob_end_flush
();

?>

Would produce:

<html>
<body>
<p>It's like comparing oranges to oranges.</p>
</body>
</html>

Смотрите также ob_get_contents(), ob_end_flush(), ob_end_clean(), ob_implicit_flush(), ob_gzhandler(), ob_iconv_handler() mb_output_handler(), and ob_tidyhandler().

Все функции PHP:
Навигация
· Новости
· Статьи
· Скачать
· Форум
· Ссылки
· Категории новостей
· Обратная связь
· Галерея
· Поиск
· CMS AP-Fusion. Отличия от PHP-Fusion
· Javascript справочник
· Техника
Сейчас на сайте
· Гостей: 1

· Пользователей: 0

· Всего пользователей: 453
· Новый пользователь: ZDA
Информеры
Загрузка файлов  +  -
9,904,017 уникальных посетителей Iceberg by Harly