public static reduceSlashes (mixed $str) Reduces multiple slashes in a string to single slashes echo Phalcon\Text::reduceSlashes("foo//bar/baz"); // foo/bar/baz echo Phalcon\Text::reduceSlashes("http://foo.bar///baz/buz"); // http://foo.bar/baz/buz
integer RANDOM_NUMERIC
integer RANDOM_NOZERO
integer RANDOM_HEXDEC
integer RANDOM_ALPHA
integer RANDOM_ALNUM
public static random ([mixed $type], [mixed $length]) 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"
public static lower (mixed $str, [mixed $encoding]) Lowercases a string, this function makes use of the mbstring extension if available echo Phalcon\Text::lower("HELLO"); // hello
public static increment (mixed $str, [mixed $separator]) 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"
public static humanize (mixed $text) Makes an underscored or dashed phrase human-readable echo Phalcon\Text::humanize('start-a-horse'); // 'start a horse' echo Phalcon\Text::humanize('five_cats'); // 'five cats'
Page 20 of 382