Questions tagged [ob-get-contents]
47 questions
-1
votes
3 answers
Transfer a variable to earier point without goto
How to write this without goto:
ob_start();
$a = 0;
echo "START of LEFT
"; begin: if($a > 0) { echo "CONTENT LEFT: $a
";
goto end;
}
<... ALL THE REST CODE OF LEFT ...>
echo "END of…
"; begin: if($a > 0) { echo "CONTENT LEFT: $a
";

KestutisIT
- 291
- 4
- 16
-2
votes
1 answer
php - ob_start / fputs suddenly doesn't work anymore, is there anything that can stop it?
My code:
function log_this($to_log, $prepend = null){
ob_start();
$fn = '../info.log';
$fp = fopen($fn, 'a');
fputs($fp, "\r\rnew log -------- \r\r");
if(isset($prepend)) fputs($fp, $prepend . ":\r\r");
…

Luca Reghellin
- 7,426
- 12
- 73
- 118