Created
December 8, 2011 08:48
-
-
Save LaffinToo/1446485 to your computer and use it in GitHub Desktop.
Trims Text for display
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Cut Text | |
// Cuts a string down and adds a ... signifier | |
// @Param1 - Text | |
// @Param2 - Optional Length, default 40 characters | |
// Return - Text Cut down to length | |
function CutText($var,$len=40) | |
{ | |
return strlen($var)>$len?substr($var,0,($len-3)):$var; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment