Answer the question
In order to leave comments, you need to log in
Why is ob_start() resetting?
Site on Bitrix. It is necessary to perform some manipulations with the markup on the pages; To do this, I wanted to buffer the output in the template, then process the received and give it to the visitor, but found that ob_get_clean () returns only part of the html. Example:
<?
// Включаю буферизацию
ob_start();
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?=LANGUAGE_ID?>" lang="<?=LANGUAGE_ID?>" <?=($htmlClass ? 'class="'.$htmlClass.'"' : '')?>>
<head>
<!-- разметка -->
</head>
<!-- дальше идёт разный код -->
</html>
<?php
// пытаюсь получить буфер и просто вывести его,
// но получаю фрагмент не с 7 строки, а уже откуда-то в конце
$modified_output = ob_get_clean();
echo $modified_output;
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question