PHP question on ob_start() and ob_end_flush()

stndn

Golden Member
Mar 10, 2001
1,886
0
0
Is there any danger on using ob_start() and ob_end_flush() in php scripts?
If i use them in my scripts just simply to avoid "header already sent" errors regardless of what i sent using header() command, is it a bad programing practice?

thanks.
 

AFB

Lifer
Jan 10, 2004
10,718
3
0
I would put it up there with the @ symbol. Sometimes you have to use it, but most times you shouldn't. Also, isn't PHP supposed to have try catch blocks in version 5? That would solve the problems with errors being displayed.