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 | |
/** | |
* Generate and return an SSCC-18 barcode. DOES NOT include leading "00" | |
* Params can be passed as strings or ints and will be padded to proper length. | |
* @param string $next_serial_available | |
* @param string $extension | |
* @param string $gs1_prefix | |
* @param string $min_serial | |
* @param string $max_serial |
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 | |
/** | |
* Take a number or numerical string and format as float | |
* Supports US and UK formats. Designed for money but will work with other formats as well. | |
* @param mixed $amount | |
* @param int $decimal_places | |
* @param int $round_mode | |
* @return float | |
*/ |
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 | |
/** | |
* Print out a stack trace from entry point to wherever this function was called. | |
* @param boolean $show_args Show arguments passed to functions? Default False. | |
* @param boolean $for_web Format text for web? Default True. | |
* @param boolean $return Return result instead of printing it? Default False. | |
*/ | |
public static function stack_trace($show_args=false, $for_web=true, $return=false){ | |
if ($for_web){ | |
$before = '<b>'; |