PHP invalid image's and error handling

后端 未结 1 582
慢半拍i
慢半拍i 2021-01-20 18:04

Using PHP\'s Image and GD functions you can use the following method to finally output the php image

imagepng($image);

Sometimes, for whate

相关标签:
1条回答
  • 2021-01-20 18:26

    What you want to do is catch PHP errors, not detect a "blank image". You can use set_error_handler() to define a custom callback that's called when an error occurs.

    Things such as parse errors are something you should debug before publishing your code, but this should help you detect random errors (database connections dying, whatnot).

    0 讨论(0)
提交回复
热议问题