How to clear previously echoed items in PHP

96

<?php

ob_start();
echo 'a';
print 'b';

// some statement that removes all printed/echoed items
ob_end_clean(); // this method clears all echos & test prints

echo 'c';

// the final output is equal to 'c', not 'abc'

?>
  
  //s 
  // https://www.codegrepper.com/code-examples/php/php+clear+echo

Comments

Submit
0 Comments