Created
April 22, 2013 15:26
-
-
Save jakeasmith/5435924 to your computer and use it in GitHub Desktop.
Just something I threw together this morning while parsing a CSV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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