프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$intervals | time interval values in seconds |
메소드 | 설명 | |
---|---|---|
array2table ( array $array, boolean $transpose = false, boolean $recursive = false, boolean $typeHint = true, array $tableOptions = ['class' => 'table table-bordered table-striped'], array $keyOptions = [], array $valueOptions = ['style' => 'cursor: default; border-bottom: 1px #aaa dashed;'], string $null = '<span class="not-set">(not set)</span>' ) : string | boolean | Convert a PHP array to HTML table. | |
boolList ( string $false = null, string $true = null ) : array | Generates a boolean list. | |
dateList ( integer $from = 1, integer $to = 31, integer $interval = 1, boolean $intervalFromZero = true, boolean $showLast = true ) : array | Generate a date picker array list for Gregorian Calendar. | |
dayList ( boolean $abbr = false, integer $start = 1, string $case = null ) : array | Generate a day array list for Gregorian calendar | |
days ( ) : array | Generate list of days. | |
formatBytes ( double $bytes, integer $precision = 2 ) : string | Format and convert "bytes" to its optimal higher metric unit. | |
getBrowser ( boolean $common = false, array $browsers = [], string $agent = null ) : array | Gets basic browser information | |
getType ( string $var ) : string | Parses and returns a variable type | |
inArray ( string $needle, array $haystack ) : boolean | Check if a value exists in the array. This method is faster in performance than the built in PHP in_array method. | |
initI18N ( ) | Initialize translations | |
isEmpty ( mixed $var ) : boolean | Check if a variable is empty or not set. | |
monthList ( boolean $abbr = false, integer $start = 1, string $case = null ) : array | Generate a month array list for Gregorian calendar | |
months ( ) : array | Generate list of months. | |
numToWords ( double $num ) : string | Number to words conversion. Returns the number converted as an anglicized string. | |
ones ( ) : array | Generate list of ones. | |
properize ( string $string ) : string | Properize a string for possessive punctuation. | |
tens ( ) : array | Generate list of tens. | |
timeElapsed ( string $fromTime = null, boolean $human = true, string $toTime = null, string $append = null ) : string | Get time elapsed (Facebook Style) | |
timeInterval ( integer $interval, string $append = null, boolean $human = true ) : string | Get time interval (Facebook Style) in a human readable format. An output could look like 14 hours ago for human friendly conversion, or 14 hours 7 minutes 55 seconds ago as a raw conversion. | |
timeList ( string $unit, integer $interval = 1, integer $from, integer $to = null, boolean $padZero = true ) : array | Generate a time picker array list. | |
triplets ( ) : array | Generate list of thousand multiples. | |
userIP ( boolean $filterLocal = true ) : string | Gets the user's IP address | |
yearList ( integer $from, integer $to = null, boolean $keys = false, boolean $desc = true ) : array | Generates a list of years. |
메소드 | 설명 | |
---|---|---|
convertTri ( double $num, integer $tri ) : string | Recursive function used in number to words conversion. Converts three digits per pass. | |
genCalList ( string $unit = 'day', boolean $abbr = false, integer $start = 1, string $case = null ) : array | Generate a month or day array list for Gregorian calendar | |
getBrowserVer ( string $agent, string $code ) : float | Returns browser version | |
time2String ( integer $time, array $intervals ) : string | Get elapsed time converted to string |
public static array2table ( array $array, boolean $transpose = false, boolean $recursive = false, boolean $typeHint = true, array $tableOptions = ['class' => 'table table-bordered table-striped'], array $keyOptions = [], array $valueOptions = ['style' => 'cursor: default; border-bottom: 1px #aaa dashed;'], string $null = '<span class="not-set">(not set)</span>' ) : string | boolean | ||
$array | array | the associative array to be converted |
$transpose | boolean | whether to show keys as rows instead of columns. This parameter should be used only for a single dimensional associative array. If used for a multidimensional array, the sub array will be imploded as text. |
$recursive | boolean | whether to recursively generate tables for multi-dimensional arrays |
$typeHint | boolean | whether to show the data type as a hint |
$tableOptions | array | the HTML attributes for the table |
$keyOptions | array | the HTML attributes for the array key |
$valueOptions | array | the HTML attributes for the array value |
$null | string | the content to display for blank cells |
리턴 | string | boolean |
protected static convertTri ( double $num, integer $tri ) : string | ||
$num | double | the source number |
$tri | integer | the three digits converted per pass. |
리턴 | string |
public static dateList ( integer $from = 1, integer $to = 31, integer $interval = 1, boolean $intervalFromZero = true, boolean $showLast = true ) : array | ||
$from | integer | the start day, defaults to 1 |
$to | integer | the end day, defaults to 31 |
$interval | integer | the date interval, defaults to 1. |
$intervalFromZero | boolean | whether to start incrementing intervals from zero if $from = 1. |
$showLast | boolean | whether to show the last date (set in $to) even if it does not match interval. |
리턴 | array |
public static dayList ( boolean $abbr = false, integer $start = 1, string $case = null ) : array | ||
$abbr | boolean | whether to return abbreviated day |
$start | integer | the first day to set. Defaults to `1` for `Sunday`. |
$case | string | whether 'upper', lower', or null. If null, then the initcap case will be used. |
리턴 | array | list of days |
public static formatBytes ( double $bytes, integer $precision = 2 ) : string | ||
$bytes | double | number of bytes |
$precision | integer | the number of decimal places to round off |
리턴 | string |
protected static genCalList ( string $unit = 'day', boolean $abbr = false, integer $start = 1, string $case = null ) : array | ||
$unit | string | whether 'day' or 'month' |
$abbr | boolean | whether to return abbreviated day or month |
$start | integer | the first day or month to set. Defaults to `1`. |
$case | string | whether 'upper', lower', or null. If null, then the initcap case will be used. |
리턴 | array | list of days or months |
public static monthList ( boolean $abbr = false, integer $start = 1, string $case = null ) : array | ||
$abbr | boolean | whether to return abbreviated month |
$start | integer | the first month to set. Defaults to `1` for `January`. |
$case | string | whether 'upper', lower', or null. If null, then the initcap case will be used. |
리턴 | array | list of months |
public static numToWords ( double $num ) : string | ||
$num | double | the source number |
리턴 | string |
public static timeElapsed ( string $fromTime = null, boolean $human = true, string $toTime = null, string $append = null ) : string | ||
$fromTime | string | start date time |
$human | boolean | if true returns an approximate human friendly output. If set to `false`, will attempt an exact conversion of time intervals. |
$toTime | string | end date time (defaults to current system time) |
$append | string | the string to append for the converted elapsed time. Defaults to ' ago'. Example Output(s): 10 hours ago |
리턴 | string |
public static timeInterval ( integer $interval, string $append = null, boolean $human = true ) : string | ||
$interval | integer | time interval in seconds |
$append | string | the string to append for the converted elapsed time. Defaults to `' ago'`. |
$human | boolean | if true returns an approximate human friendly output. If set to `false`, will attempt an exact conversion of time intervals. |
리턴 | string |
public static timeList ( string $unit, integer $interval = 1, integer $from, integer $to = null, boolean $padZero = true ) : array | ||
$unit | string | the time unit ('hour', 'min', 'sec', 'ms') |
$interval | integer | the time interval. |
$from | integer | the time from (defaults to 23 for hour |
$to | integer | the time to (defaults to 1). |
$padZero | boolean | whether to pad zeros to the left of each time unit value. |
리턴 | array |
public static yearList ( integer $from, integer $to = null, boolean $keys = false, boolean $desc = true ) : array | ||
$from | integer | the start year |
$to | integer | the end year |
$keys | boolean | whether to set the array keys same as the values (defaults to false) |
$desc | boolean | whether to sort the years descending (defaults to true) |
리턴 | array |