Метод | Описание | |
---|---|---|
CompressOutput ( |
To compress data in GZIP and print it. | |
TimeZoneList ( ) : Array | All the timezone list by region | |
arrayExtend ( Array $a, Array $b ) : Array | To extend an array with another array by merging the data and update them with new a | |
arrayFlatten ( array $ar, Array $f = [] ) : mixed | To flatten multi dimensional array into a flat one. Also preserve the key | |
arrayToDotNotation ( type $Arr ) : type | Convert an array to dot notation | |
array_merge_recursive_distinct ( ) | Merges any number of arrays / parameters recursively, replacing entries with string keys with values from latter arrays. | |
array_msort ( |
Array Multi sort wi $arr2 = array_msort($arr1, array('name'=>array(SORT_DESC,SORT_REGULAR), 'cat'=>SORT_ASC)); | |
calculateDistance ( |
To calculate distance between to coordinaces | |
camelize ( type $string, type $pascalCase = false ) : type | Camelize | |
convertCm2In ( |
Cm to inches | |
convertCm2M ( |
Cm to meters | |
convertIn2Cm ( |
inches to cm | |
convertIn2Ft_human ( |
Human inches value and convert it to a human readable | |
convertM2Cm ( |
Meters to cm | |
countWords ( $str ) | To count total words in a string | |
createTagCloud ( array $Tags, string $Link = "", INT $cloud_spread, |
To create a tag cloud based on the tags provided | |
curlRequest ( string $url, mixed $params = [], string $method = "GET", array $curlOptions = [] ) : Array | To make a simple curl request For more advanced curl request, use the Guzzle library | |
dasherize ( type $str ) : type | To dasherize HelloWorld = Hello-World | |
dateDifference ( $date1, $date2, $abs = true ) : Array(seconds,minutes,hours,days...) | Calculate the date diff between 2 dates | |
excerpt ( string $text, integer $wordCount = 250 ) : string | Will create an excerpt of the content. Will remove any html tags | |
filterDirtyWords ( $list, $hidden = "", $str = "" ) | # CLEAN DIRTY WORD | |
formatDate ( |
To format a YYY-MM-DD HH:II:SS into a human readable | |
formatInvoice ( $n, $zeroPad = 9 ) | ------------------------------------------------------------------------------ | |
formatPhoneNumber ( $phone = '', $returnRaw = false, $trim = true, $convert = false ) | ||
formatTweets ( $status, $targetBlank = true, $linkMaxLen = 250 ) : String | formatTweets | |
generatePathFromSequencedNumber ( $str, $paddingLength = 12 ) : string | To generate a path sequence from a number if str is 546372 It will create a 3 level path 000/000/546 | |
generateRandomString ( INT $strLen = 7, INT $minLen = 5, BOOL $randomLen = false, BOOL $noCloseSameChar = true, |
generateRandomString() To create a random string with a specific length. | |
getAge ( Datetime $dob ) : integer | Calculate an age | |
getArrayDotNotationValue ( array $Data, String $dotNotationKeys = "", mixed $emptyValue = "" ) : Mixed: | Read data in array, based on dotNotationKeys | |
getDomain ( $url ) | * Return the domain name of a url | |
getJsonLastError ( ) : Array | Get json last error after json_decode() | |
getNonce ( integer $size = 32 ) : string | To generate a nonce token | |
getPastDateRange ( $date = "" ) : Array(INT | To generarate date in the past. Will return an Array(0=>start time,1=>end time) Can be used when making a date range query, and would like to get the stat and the end | |
multiArraySearch ( $needle, $haystack, $index_starter ) | ||
number_format_HumanReadable ( |
To format a number and return it as K,M,T | |
paginationGetMaxLimit ( integer $pageNumber = 1, inte $itemsPerPage ) : integer | Get the max limit in a pagination | |
paginationGetMinLimit ( integer $pageNumber = 1, inte $itemsPerPage ) : integer | Get the min limit in a pagination | |
paginationGetTotalPages ( integer $totalItems, integer $itemsPerPage ) : integer | To get the total pages from set values in pagination | |
recursiveCopy ( $src, $dest ) : |
Copy file recursively | |
recursiveDelete ( strin $dir ) : boolean | Delete file recursively | |
removeRepetitiveChar ( |
To remove repetitive chars in a string that are close to each other | |
removeUrl ( $data ) | ||
seconds2Time ( $secs ) : string | To convert seconds into time -> HH:MM:SS. It will ommit the hours if not available | |
setArrayToDotNotation ( type &$root, type $dotNotationKeys, type $value ) | To set value in array with dot notation | |
strPossessive ( string $string ) : string | To create a possesive. | |
stripHtmlComments ( string $content ) : string | To strip html comments. | |
time2Seconds ( string $time ) : integer | Convert a time HH:MM:SS to seconds | |
timeSince ( $time ) : string | To calculate a time since the $timestamp and will return it into a human readable date, like 2 hours ago, 7 weeks ago created for twitter and statuses | |
toCurrency ( |
Format number to currency | |
toFriendlyUrl ( $O ) | # To make an URL Friendly | |
toUnderscore ( type $str ) : string | To convert camelized case to underscore | |
truncate ( $str, $max_chars = 3000, $force = 1 ) | # May 27 2005 | |
validEmail ( $email ) | ||
validIP ( $str ) | ||
validLogin ( string $str, integer $min = 4, integer $max = 64 ) : boolean | Check if a login is valid | |
validPassword ( string $str, integer $min = 6, integer $max = 32 ) : boolean | Check if a password is valid | |
validUrl ( $str ) | ||
validZipCode ( $zip ) |
Метод | Описание | |
---|---|---|
timeSince_read ( |
To return a the human readable time since of self:timeSince |
public static CompressOutput ( |
||
$content | ||
Результат |
public static TimeZoneList ( ) : Array | ||
Результат | Array |
public static arrayExtend ( Array $a, Array $b ) : Array | ||
$a | Array | - The original array |
$b | Array | - The array to merge with |
Результат | Array |
public arrayFlatten ( array $ar, Array $f = [] ) : mixed | ||
$ar | array | |
$f | Array | - am array to extend to |
Результат | mixed | Arr- boolean |
public static arrayToDotNotation ( type $Arr ) : type | ||
$Arr | type | |
Результат | type |
public static array_merge_recursive_distinct ( ) |
public static array_msort ( |
||
$array | ||
$cols | ||
Результат | Array | http://php.net/manual/en/function.array-multisort.php |
public static calculateDistance ( |
||
$lat1 | ||
$lon1 | ||
$lat2 | ||
$lon2 | ||
$unit | ||
Результат |
public static camelize ( type $string, type $pascalCase = false ) : type | ||
$string | type | |
$pascalCase | type | - if true = CamelCase, else camelCase |
Результат | type |
public static convertCm2In ( |
||
$val | ||
Результат |
public static convertCm2M ( |
||
$val | ||
Результат |
public static convertIn2Cm ( |
||
$val | ||
Результат |
public static convertIn2Ft_human ( |
||
$val | ||
$dumb | ||
Результат |
public static convertM2Cm ( |
||
$val | ||
Результат |
public static countWords ( $str ) |
public createTagCloud ( array $Tags, string $Link = "", INT $cloud_spread, |
||
$Tags | array | - array($tagName=>$tagCount) |
$Link | string | - Link to connect to the tags |
$cloud_spread | INT | - max tags to show |
$sort | ||
$title | string | - the title to enter in the link. Can be formatted with %tag% | %count% to add the tag and count respectively in the a href title |
$sizeTags | boolean | - to allow multiple size of fonts |
Результат | String | LI |
public static dasherize ( type $str ) : type | ||
$str | type | |
Результат | type |
public static dateDifference ( $date1, $date2, $abs = true ) : Array(seconds,minutes,hours,days...) | ||
Результат | Array(seconds,minutes,hours,days...) |
public static filterDirtyWords ( $list, $hidden = "", $str = "" ) |
public static formatDate ( |
||
$datetime | ||
Результат |
public static formatInvoice ( $n, $zeroPad = 9 ) |
public static formatPhoneNumber ( $phone = '', $returnRaw = false, $trim = true, $convert = false ) |
public static formatTweets ( $status, $targetBlank = true, $linkMaxLen = 250 ) : String | ||
Результат | String |
public static generatePathFromSequencedNumber ( $str, $paddingLength = 12 ) : string | ||
Результат | string | new path |
public static generateRandomString ( INT $strLen = 7, INT $minLen = 5, BOOL $randomLen = false, BOOL $noCloseSameChar = true, |
||
$strLen | INT | : the maximum length of the new string |
$minLen | INT | : The minimum length to generate the $randomLen |
$randomLen | BOOL | : to generate random length between $strLen and $minLen |
$noCloseSameChar | BOOL | : If you don't want two same chars to be close to each other |
$addZeroOne | ||
Результат | STRING | : a new length of string |
public static getArrayDotNotationValue ( array $Data, String $dotNotationKeys = "", mixed $emptyValue = "" ) : Mixed: | ||
$Data | array | |
$dotNotationKeys | String | - the dot notation, i.e, "key.subkey.subsubkey" |
$emptyValue | mixed | - A value to return if dotNotArg doesnt find any match |
Результат | Mixed: |
public static getDomain ( $url ) |
public static getJsonLastError ( ) : Array | ||
Результат | Array | if error or FALSE |
public static getPastDateRange ( $date = "" ) : Array(INT | ||
Результат | Array(INT |
public static multiArraySearch ( $needle, $haystack, $index_starter ) |
public static number_format_HumanReadable ( |
||
$number | ||
$decimals | ||
Результат |
public static paginationGetMaxLimit ( integer $pageNumber = 1, inte $itemsPerPage ) : integer | ||
$pageNumber | integer | |
$itemsPerPage | inte | |
Результат | integer |
public static paginationGetMinLimit ( integer $pageNumber = 1, inte $itemsPerPage ) : integer | ||
$pageNumber | integer | |
$itemsPerPage | inte | |
Результат | integer |
public static recursiveCopy ( $src, $dest ) : |
||
Результат |
public static recursiveDelete ( strin $dir ) : boolean | ||
$dir | strin | |
Результат | boolean |
public static removeRepetitiveChar ( |
||
$string | ||
$charToRemove | ||
$max | ||
$replacement | ||
Результат |
public static seconds2Time ( $secs ) : string | ||
Результат | string | HH:MM:SS |
public static setArrayToDotNotation ( type &$root, type $dotNotationKeys, type $value ) | ||
$root | type | |
$dotNotationKeys | type | |
$value | type |
public static strPossessive ( string $string ) : string | ||
$string | string | |
Результат | string |
public static stripHtmlComments ( string $content ) : string | ||
$content | string | |
Результат | string |
public static time2Seconds ( string $time ) : integer | ||
$time | string | -> HH:MM:SS |
Результат | integer |
public static toCurrency ( |
||
$digit | ||
Результат |
public static toFriendlyUrl ( $O ) |
public static toUnderscore ( type $str ) : string | ||
$str | type | - ie: HelloWorld = Hello_World |
Результат | string |
public static truncate ( $str, $max_chars = 3000, $force = 1 ) |