printing - Disable echo and print in PHP -
this may seem funny question in fact it's not, disable echo
, print
, other functions may output buffer such readfile
.
the reason why prevent client using echo
or print
outside rules of application, forcing them compile contents , send output class, whole buffer managed.
now know can set output buffer @ start of script , throw away content, not include things such header
, set_cookie
, question may interpreted how can control buffer head of response
is there possible way manage aspects of php's outputting, such assign callback main buffer rather body of response?
at end there no effective way achieve this, because @ least echo
not function, language construct, cannot disabled. may play around output buffering (ob_start()
, such), not prevent other code disable output buffering again.
in eyes there no way around make sure, there "good code". don't know, mean "prevent client", not execute arbitrary code anyway. , if written disciplined developers , tested, there should no problem then.
Comments
Post a Comment