Skip to content

Instantly share code, notes, and snippets.

@HomenSimpsor
Last active December 14, 2015 07:19
Show Gist options
  • Save HomenSimpsor/5050161 to your computer and use it in GitHub Desktop.
Save HomenSimpsor/5050161 to your computer and use it in GitHub Desktop.
Used for error_logging a bunch of variables all at once.
<?php
$label = 'test';
$data = array (
'label' => $datum
);
$logs[] = array($label, $data);
foreach ($logs as $log):
list($label, $data) = $log;
foreach ($data as $key => $value):
if (is_array($value)):
$value = print_r($value, true);
endif;
error_log("[$label]: [$key -> $value]");
endforeach;
endforeach;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment