While debugging, it would help if I could exit() and use a foreach to print individual elements of an array. Any ideas?
5条回答 默认 最新
dongxiao0449 2011-02-26 01:10关注If you want to easily print the contents of an array or any other PHP value, use
var_dump. Callingexit()is orthogonal to this, and I think it's quite clear to write:var_dump($arr); exit(1);Another technique is to log your output, which is potentially more useful if you don't want to sift through your output HTML to look for the output of
var_dump:error_log(var_export($arr)); exit(1);本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报