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
<?php | |
class Time | |
{ | |
public $h; | |
public $i; | |
public $s; | |
public $f; | |
private static $unitData = array( |
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
<?php | |
class JsonDumper | |
{ | |
/** @var string */ | |
private $json; | |
/** @var int spaces to use for one indentation level */ | |
private $indentation; |
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
<?php | |
class AsciiTable | |
{ | |
private $rows; | |
private $columns; | |
private $headers = array(); | |
private $data = array(); | |
private $separators; | |
private $headerPadMethod; |
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
<?php | |
class NumberSpell | |
{ | |
public $number; | |
public $spelled; | |
private $rules = array( | |
0 => array('one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine'), | |
1 => array(null, 'twen', 'thir', 'for', 'fif', null, null, null, null) |
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
<?php | |
/** | |
* This class brings support for milliseconds, explicit recalculation of carry-over points | |
* and human-friendly formatting | |
*/ | |
class DateIntervalEnhanced extends DateInterval | |
{ | |
public $ms = 0; | |
private $unitData = array( |
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
<?php | |
class StringTransform | |
{ | |
/** | |
* This Method Converts a String to Title Case | |
* Not context-aware and just for english. | |
* | |
* @param string $str | |
* @param bool $apStyle use AP-Style title case if true |
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
<?php | |
class Media | |
{ | |
public $calcBase = 1024; | |
public $fileSize = 0; | |
public $sizePrefixes = array( | |
1000 => array( | |
'', | |
'K', |
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
<?php | |
function parseColorString($str, $format = 'hex') { | |
$str = strtolower(trim($str)); | |
// prevent errors for an empty string and ignore 'transparent' | |
if ($str == '' || $str == 'transparent') { | |
return false; | |
} | |
// replace nonvalid hex characters with 0 |