Sunday, October 5, 2008

PHP -- Supress Warnings

Yesterday i was working on PHP's file handling functions. Due to default permissions i was getting default warnings generated by PHP Engine. I decided to suppress the warning messages. Found out a very simple solution for this problem.

Just need to put a @ before calling file handling functions.

$handle = @ fwrite("abc.txt", "w");

After this warning messages were not rendered on the screen.

No comments: