1//why use ob_start() in php
2
3<?php
4ob_start(); //Start remembering everything that would normally be outputted, but don't quite do anything with it yet
5$output = ob_get_contents(); //Gives whatever has been "saved"
6ob_end_clean(); //Stops saving things and discards whatever was saved
7ob_flush(); //Stops saving and outputs it all at once
8
9?>
1ob_start(); //Start remembering everything that would normally be outputted, but don't quite do anything with it yet
2$output = ob_get_contents(); //Gives whatever has been "saved"
3ob_end_clean(); //Stops saving things and discards whatever was saved
4ob_flush(); //Stops saving and outputs it all at once
1<?php ob_start(); ?>
2
3<div>
4 <p>Here go your view</p>
5</div>
6
7<?php $content = ob_get_clean(); //now you can echo the content in base.php ?>
8<?php require( __DIR__ . './base.php'); ?>