Provides utilities to work with texts
Converts strings to camelize style
echo Phalcon\Text::camelize('coco_bongo'); //CocoBongo
Uncamelize strings which are camelized
echo Phalcon\Text::uncamelize('CocoBongo'); //coco_bongo
Adds a number to a string or increment that number if it already is defined
echo Phalcon\Text::increment("a"); // "a_1" echo Phalcon\Text::increment("a_1"); // "a_2"
Generates a random string based on the given type. Type is one of the RANDOM_* constants
echo Phalcon\Text::random(Phalcon\Text::RANDOM_ALNUM); //"aloiwkqz"
Check if a string starts with a given string
echo Phalcon\Text::startsWith("Hello", "He"); // true echo Phalcon\Text::startsWith("Hello", "he"); // false echo Phalcon\Text::startsWith("Hello", "he", false); // true
Check if a string ends with a given string
echo Phalcon\Text::endsWith("Hello", "llo"); // true echo Phalcon\Text::endsWith("Hello", "LLO"); // false echo Phalcon\Text::endsWith("Hello", "LLO", false); // true
Lowercases a string, this function makes use of the mbstring extension if available
Uppercases a string, this function makes use of the mbstring extension if available
© 2011–2016 Phalcon Framework Team
Licensed under the Creative Commons Attribution License 3.0.
https://docs.phalconphp.com/en/2.0.0/api/Phalcon_Text.html