​loginfo函数怎么在php中使用

​loginfo函数怎么在php中使用

loginfo函数怎么在php中使用?相信很多没有经验的人对此束手无策,为此本文总结了问题出现的原因和解决方法,通过这篇文章希望你能解决这个问题。

loginfo函数:

function loginfo($format) {
  $args = func_get_args();
  array_shift($args);
  $d = debug_backtrace(DEBUG_BACKTRACE_PROVIDE_OBJECT, 1)[0];
  $info = vsprintf($format, $args);
  $data = sprintf("%s %s,%d: %s\n", date("Ymd His"), $d["file"], $d["line"], $info);
  file_put_contents(__DIR__."/log.txt", $data, FILE_APPEND);
}

看完上述内容,你们掌握loginfo函数怎么在php中使用的方法了吗?如果还想学到更多技能或想了解更多相关内容,欢迎关注行业资讯频道,感谢各位的阅读!