Page 1 of 1

make a variable only 19 character long?

Posted: Tue Jul 04, 2006 9:05 pm
by jasondavis
Ok I got

Code: Select all

$decrypted = mb_substr($decrypted, 0, 19);
this trims my variablke to 19 characters, how can I make it show the 19 characters then "..." but only show if it is over 19 characters?

Posted: Tue Jul 04, 2006 10:33 pm
by Roja

Code: Select all

if (mb_strlen($decrypted) > 19) { $decrypted .= '...'; }