mikefrederick Posted March 31, 2008 Share Posted March 31, 2008 I have come across a rare case in which it is understandable that a headers already sent error occurs, but I need the code to remain as is. I would explain further but it is intricate... Is there anyway to make it so that the warning does not show up on the page? Link to comment https://forums.phpfreaks.com/topic/98843-ignore-warnings/ Share on other sites More sharing options...
mikefrederick Posted March 31, 2008 Author Share Posted March 31, 2008 by the way i know you can use error_reporting I just never have and don't know the specifics of the function Link to comment https://forums.phpfreaks.com/topic/98843-ignore-warnings/#findComment-505769 Share on other sites More sharing options...
mikefrederick Posted March 31, 2008 Author Share Posted March 31, 2008 and also i don't want to do error_reporting(0)...just want to turn the header error off. Link to comment https://forums.phpfreaks.com/topic/98843-ignore-warnings/#findComment-505770 Share on other sites More sharing options...
trq Posted March 31, 2008 Share Posted March 31, 2008 You can simply turn display errors off for that particular script. <?php ini_set('display_errors','0'); ?> Link to comment https://forums.phpfreaks.com/topic/98843-ignore-warnings/#findComment-505774 Share on other sites More sharing options...
trq Posted March 31, 2008 Share Posted March 31, 2008 Of course depending on what is causing the error, you could wrap your output in a buffer (using ob_start()) thus actually removing the cause of the error. Link to comment https://forums.phpfreaks.com/topic/98843-ignore-warnings/#findComment-505778 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.