Skip to content

Instantly share code, notes, and snippets.

@ecpplus
Created December 17, 2011 05:31
Show Gist options
  • Save ecpplus/1489341 to your computer and use it in GitHub Desktop.
Save ecpplus/1489341 to your computer and use it in GitHub Desktop.
PHPで var_dump や print_r の出力をファイルに保存
ob_start();
print_r('$this->user_id');
var_dump($this->user_id);
$result = ob_get_contents();
ob_end_clean();
$fp = fopen("./debug.txt", "a+" );
fputs($fp, $result);
fclose( $fp );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment