最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

【整理】php打印出可读的友好的变量的信息

PHP crifan 1915浏览 0评论

leeoniya/dump_r.php – PHP

PHP: var_dump – Manual

PHP: print_r – Manual

PHP: var_export – Manual

php – How to output (to a log) a multi-level array in a format that is human-readable? – Stack Overflow

print_r is best for readability but it doesn’t print null/false values.

var_dump is best for checking types of values and lengths and null/false values.

var_export is simmilar to var_dump but it can be used to get the dumped string.

【总结】

print_r或var_dump或var_export,可以打印出可读性不错的变量信息。

转载请注明:在路上 » 【整理】php打印出可读的友好的变量的信息

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
84 queries in 0.155 seconds, using 22.12MB memory