Skip to content
Sunil Kushwaha edited this page Aug 27, 2015 · 24 revisions

Below is the quick reference for all function this library has.

String functions

str.chr('asc')                        // Returns a character from the specified ASCII value.
str.lcfirst()                         // Convert first letter to lower case of a string
str.ucfirst()                         // Convert first letter to upper case of a string
str.pad('padCh', padLen, 'padMode')   // Pad a string with the characters that are given as arguments
str.repeat('len')                     // Repeats a specific string till 'len' number of times
str.ucwords()                         // Upper case first letter of the word.
str.htmlspecialchars()                // Convert special characters to HTML entities
str.html_entities_decode()            // Converts html entities to characters
str.reverse('c')                      // Reverse the string
str.rtrim('c')                        // Trims specified character from the end of th string, by default removes space
str.ltrim()                           // Trims specified character from the beginning of the string, by default removes space
str.strstr('needle',bool)             //Returns string after the given string if bool is false else returns string before the given string.

Array functions

arr.unique()                      // Get unique elements from one dimensional array
arr.has_duplicates()              // Returns True/False if array has duplicate element
arr.has_duplicates_assoc('phone') // Returns True/False if associative array has duplicate element based on key provided
arr.duplicates()                  // Returns object containing duplicate elements with their occurrences
arr.duplicates_assoc('phone')     // Returns object same as above but for associative array
arr.shuffle()                     // Returns shuffled string
arr.nl2br()                       // Returns string with '<br />' or '<br>' inserted before all newlines (\r\n, \n\r, \n and \r).
Clone this wiki locally