Update common.php

This commit is contained in:
Anyon 2020-03-09 17:03:52 +08:00
parent ed761837d5
commit f8ffcdd997

View File

@ -27,7 +27,7 @@ use think\Db;
function p($data, $replace = false, $pathname = null) function p($data, $replace = false, $pathname = null)
{ {
is_null($pathname) && $pathname = RUNTIME_PATH . date('Ymd') . '.txt'; is_null($pathname) && $pathname = RUNTIME_PATH . date('Ymd') . '.txt';
$str = (is_string($data) ? $data : (is_array($data) || is_object($data)) ? print_r($data, true) : var_export($data, true)) . "\n"; $str = (is_string($data) ? $data : ((is_array($data) || is_object($data)) ? print_r($data, true) : var_export($data, true))) . "\n";
$replace ? file_put_contents($pathname, $str) : file_put_contents($pathname, $str, FILE_APPEND); $replace ? file_put_contents($pathname, $str) : file_put_contents($pathname, $str, FILE_APPEND);
} }