最新消息:20210917 已从crifan.com换到crifan.org

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

PHP crifan 1610浏览 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,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
94 queries in 0.186 seconds, using 23.35MB memory