This file contains 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
/** | |
* Custom function to round down to the nearest lowest number at 2 decimal places. | |
* e.g: 1.006 rounds down to 1.00 | |
* Warning: Do not use PHP_ROUND_HALF_DOWN; | |
* round(0.006, 2, PHP_ROUND_HALF_DOWN) does not round down to 0 | |
* | |
* @param $value | |
* - Must be numeric | |
* - Must be a positive value | |
* @return float |
This file contains 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
function wordWrapAtCharacter($str, $minWidth = 200, $char = ',', $lineBreak = "\n") | |
{ | |
// prev pos | |
$marker = 0; | |
// char pos | |
$pos = false; | |
if($minWidth+$marker < strlen($str)) | |
{ | |
$pos = strpos($str,$char,$minWidth+$marker); | |
} |
This file contains 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
/** | |
* Create plain Text table from Array, or Array of Arrays. | |
* Great for dumping database table data to text only logs or display. | |
* @use String::textTableFromArray($myArrayOfArrays,'My Multi Row Table',true); // multiple records/array | |
* ArrayHelper::textTableFromArray($simpleKeyValArray,'A Single Record',false); // single row, vertical view | |
* @requires String::humanize() ... or just remove/override it. | |
* | |
* @param $arr | |
* @param string $tableTitle | |
* @param bool $horizontalDisplay |
This file contains 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
<div class="row"> | |
<div class="span4">...</div> | |
<div class="span4 offset4">...</div> | |
</div> |