All Functions

truncate - truncate string length

Truncate returns a portion of a string specified by the length parameter. It is used to limit the maximum length of a string by removing characters beyond the length parameter..

"To Truncate" = to shorten it, or cut part of it off.


truncate ( $string , $length ) Returns part of a string that does not exeed the defined length


$string The string to be shortened in length
$length The maximum string length. Characters beyong this position will be removed.


Shortening a Number

Returns the string 12345

Limit the length of a string

Returns the first 3 characters "Him"

See also

strip - remove all whitespace trim - remove whitespace reverse - reverse a string replace - string replace leftpad - Left Padding rightpad - Right Padding