<?php
$log = array(
"x1" => "y1",
"x2" => "y2",
"x3" => "y3"
);
//バッファ出力開始
ob_start();
//配列をダンプ
var_dump($log);
//バッファの内容を変数に代入
$dump = ob_get_contents();
// バッファ終了
ob_end_clean();
error_log($dump,3,'./dump.txt');
error_log(var_export($log, true), 3, "./export.txt");
error_log(print_r($log, true), 3, "./r.txt");
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme