library php-commons
Some common php functions
stinger-soft/php-commons
Some common php functions
- Thursday, November 2, 2017
- by Viburnum
- Repository
- 3 Watchers
- 0 Stars
- 1,469 Installations
- PHP
- 7 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 3 Versions
- 2 % Grown
PhpCommons
Some common methods to ease the life of anonymous PHP developers, (*1)
String
-
startsWith Tests if a string starts with the specified prefix.
-
endsWith Tests if a string ends with the specified suffix
-
camelize Uppercases the first character of each word in a string
-
excerpt Creates an excerpt from a text based on a phrase
-
highlight Highlights (i.e. adds html-tags arround the keyword) a given keyword in a string
Array
-
insertElement Adds an element into a array on the given position without replacing the old entry
-
removeElementByValue Removes the given element from the array
-
mergeArrayValues Creates an array of arrays from the two given arrays.
-
getPrevKey Returns the previous key from an array
-
getNextKey Returns the next key from an array
-
applyCallbackByPath Applies a callback on a part of a multidimensional array defined by its path (i.e. keys)
Byte
-
prettyPrintSize Pretty prints a given memory/file size (e.g. 1024 -> 1kB)
Time
-
prettyPrintMicroTimeInterval Pretty prints an interval specfied by two timestamps.
-
getRelativeTimeDifference Get the relative difference between a given start time and end time.
, (*2)