Skip to content

Instantly share code, notes, and snippets.

@sidouglas
Created January 8, 2020 10:55
Show Gist options
  • Save sidouglas/1bacda9cdb328f297e724a57b42bc350 to your computer and use it in GitHub Desktop.
Save sidouglas/1bacda9cdb328f297e724a57b42bc350 to your computer and use it in GitHub Desktop.
Php output buffering using ob_start
<?php ob_start(); ?>
// something that's printing
<?php
$contents = ob_get_contents();
ob_end_clean();
return $contents;
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment