Revision: 59194
Updated Code
at August 23, 2012 05:35 by Gianino
Updated Code
function short($txt,$size){ $short = $size - 3; if(strlen($txt) > $size){ $data = substr( $txt, 0, $short )."..."; } else { $data = $txt; } return $data; } echo short('Gianino Cole',10);
Revision: 59193
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at August 23, 2012 05:30 by Gianino
Initial Code
zxczxczxczxc
Initial URL
Initial Description
Reduces the string size according to the parameter that has been send and put '...' at the end of the new string
Initial Title
Shortening a string
Initial Tags
php
Initial Language
PHP