Skip to content

Instantly share code, notes, and snippets.

@yo-iida
Created April 15, 2014 10:33
Show Gist options
  • Select an option

  • Save yo-iida/10721377 to your computer and use it in GitHub Desktop.

Select an option

Save yo-iida/10721377 to your computer and use it in GitHub Desktop.
PHP:関数の呼び出し元をさぐる
$path_str = “ログファイルパス”;
ob_start();
var_dump(debug_backtrace());
$ob_result = ob_get_contents();
ob_end_clean();
$filedata = date(“Y.m.d H:i:s”,time()).”\r\n”.$ob_result.”\r\n”;
file_put_contents($path_str,$filedata,FILE_APPEND);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment