You are here: Re: no echo after include? « PHP Programming Language « IT news, forums, messages
Re: no echo after include?

Posted by Rami Elomaa on 04/07/07 21:27

Toby A Inkster kirjoitti:
> usenet wrote:
>> den5385@gmail.com wrote:
>>
>>> <?php
>>> echo "bbb";
>>> include("common/funcs.php");
>>> echo "a";
>>> ?>
>>>
>>> Everying print or echo statement after the include gets ignored. Why
>>> would this be?
>> Something in the included file is probably causing processing to terminate. Try
>> checking your error log for clues.
>
> That's the most likely explanation. Another possible explanation, though
> less likely, is that funcs.php turns on output buffering.
>

Close, but no cigar. The included file might turn on output buffering,
but if nothing catches the buffer and cleans it, then everything is
output normally when the program exits.

<?php
echo "bbb";
include("common/funcs.php");
echo "a";
ob_end_clean(); // the original script doesn't have this
?>

Of course there is register_shutdown_function(), so yeah, it's
_possible_ to get the ob_end_clean executed at the end without it being
in the script, not very likely though. :)

--
Rami.Elomaa@gmail.com
"Olemme apinoiden planeetalla."

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация