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;

?>

 
okhayat replied on at Permalink Best Answer Reply
okhayat
From the PHP manual:
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.
kappi replied on at Permalink Reply
Thanks again Okhayat