How to print a debug log?

前端 未结 15 1816
北海茫月
北海茫月 2020-12-12 10:07

I\'d like to debug some PHP code, but I guess printing a log to screen or file is fine for me.

How should I print a log in PHP code?

The u

15条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-12 10:21

    Simply way is trigger_error:

     trigger_error("My error");
    

    but you can't put arrays or Objects therefore use

    var_dump
    

提交回复
热议问题