suppressing the output of an include file in php

Soldato
Joined
14 Jul 2003
Posts
14,848
Hi all,

I've got a file that I have to call using the PHP "include" function. What I want to do is suppress the output of the file but still have it run. It's not intended to be run silently like this and as such spits out information which I don't need, but also carries out a operation that I do want.

So say the code is:
<?php
include('test.php');
?>

and menu.php spits out information, is there a way of suppressing this output or sending it somewhere other than the browser?

I thought I could hide the textby doing the following and although it stops any output I don't think it's allowing the test.php's operation to run either.

<?php
ob_start();
include('test.php');
ob_end_clean();
?>

It's not for anything dodgy, honest :D Any ideas?
 
Back
Top Bottom