Skip to content

Instantly share code, notes, and snippets.

@rohjay
Created March 27, 2019 17:57
Show Gist options
  • Save rohjay/bb5d5c77ff5f4beb40cc4f5106eb6049 to your computer and use it in GitHub Desktop.
Save rohjay/bb5d5c77ff5f4beb40cc4f5106eb6049 to your computer and use it in GitHub Desktop.
Var dump to the error log
<?php
function var_dump_to_error_log($data) {
ob_start();
var_dump($data);
$error_log_this = ob_get_contents();
ob_end_clean();
error_log($error_log_this);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment