I have a file PHP01.php
which:
- performs a function
- creates an array
- echo's some message
I need to include this file in another php script, say PHP02.php
as I need access to the array it created. But when I jquery POST request to PHP02.php
, the data it returns also has the echo
from PHP01.php
How can I suppress the echo from the first file?
You can output buffer it if editing or otherwise restructuring is not possible:
ob_start();
include "PHP02.php";
ob_end_clean();
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