PHP中捕获var_dump的结果赋值给字符串

php文档中对缓冲区有这样的描述:

As with anything that outputs its result directly to the browser, the output-control functions can be used to capture the output of this function, and save it in a string

那我们是不是能利用这一点将var_dump的结果捕获且赋值给某变量呢?

测试代码:

 

发表评论

电子邮件地址不会被公开。 必填项已用*标注

This site uses Akismet to reduce spam. Learn how your comment data is processed.