not sure what this means
Permalink 1 user found helpful
Hi there, I understand that here we are making a new area for the nav bar and I'm aware that ob_start() creates or uses a buffer in which to store content but what is ob_get_contents()
Thanks for your help.
<?php
$ah = new Area('Header Nav');
ob_start();
$ah->display($c);
$printed = ob_get_contents();
ob_end_clean();
$printed = str_replace('<li class="nav-selected', '<li class="active', $printed);
print $printed;
?>
Thanks for your help.
<?php
$ah = new Area('Header Nav');
ob_start();
$ah->display($c);
$printed = ob_get_contents();
ob_end_clean();
$printed = str_replace('<li class="nav-selected', '<li class="active', $printed);
print $printed;
?>
http://php.net/manual/en/function.ob-get-contents.php...
ob_get_contents — Return the contents of the output buffer
So, the buffer content is assigned to $printed variable, before outputting it.