I would like to access some functions defined in another PHP file, but that file also outputs content that I don't want to display.
Is there any way to access the functions without "running" the whole file? Perhaps by redirecting the output from that file to somewhere hidden?
<?php
ob_start();
require 'filename.php';
ob_end_clean();
?>
Eh you might be able to do something with using the output buffer and manually clearing contents, but why not just move the common functions into a common include? I usually shove common helper methods into their own file (which won't output anything).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With