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

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

String functions

str.lcfirst                       // Convert first letter to lower case of a string
str.ucfirst                       // Convert first letter to upper case of a string
str.strpad                        // Pad a string with the characters that are given as arguments
str.repeat                        // 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                       // Reverse the string
str.rtrim                         // 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

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
Clone this wiki locally