Skip to content

Instantly share code, notes, and snippets.

@jakeasmith
Created April 22, 2013 15:26
Show Gist options
  • Save jakeasmith/5435924 to your computer and use it in GitHub Desktop.
Save jakeasmith/5435924 to your computer and use it in GitHub Desktop.
Just something I threw together this morning while parsing a CSV
<?php
/**
* Spits debug output to the terminal
*
* @return void
* @author Jake A. Smith
* @param string $msg the string to display
* @param int $line_breaks number of line breaks
* @param $bool $before Determines whether the line breaks will show before or after the message
**/
function msg($msg, $line_breaks = 1, $before = false)
{
$space = '';
while($line_breaks != 0) {
$space .= PHP_EOL;
$line_breaks--;
}
echo $before
? $space . $msg . PHP_EOL
: $msg . $space;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment