0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

var_dump() の出力を文字列として取得する

Last updated at Posted at 2015-12-21

var_dump() の内容をHTTP出力ではなく例えばロギング関数に渡したいことがある。

ob_start(); var_dump($someVar); my_logger(ob_get_clean());

参考

How can I capture the result of var_dump to a string?

0
2
2

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?