Question: Number of Characters

From: Date: Sun, 01 Apr 2001 23:16:23 +0000
Subject: Question: Number of Characters
Groups: php.general 
Request: Send a blank email to php-general+get-46529@lists.php.net to get a copy of this message
How can i determine the number of characters in a string? I am using substr to cut off the last 4 characters of a string. Which is working great. But I want to replace the 3 charcters with "..." only if there are over 20 charcters . I tried substr_replace but it appears on everything no matter how many characters. I am trying to do this is simple terms: if the string was: hi my name is it is returned shortened to: hi ... Any help appreciated.

« previous php.general (#46529) next »