RE: [PHP] remove last character in a string
| From: | Craig Westerman | Date: | Tue, 23 Apr 2002 03:46:28 +0000 |
| Subject: | RE: [PHP] remove last character in a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94103@lists.php.net to get a copy of this message | ||
Wouldn't it be better to check to see if charicater is indeed a comma before
removing it?
I was guessing eregi_replace would be the way to go.
Am I thinking wrong?
Craig ><>
westerman@chanuteks.com
First, you'll need to get the length of the str with the str_len() function.
After you have that, use the substr() function like Rasmus mentioned.
Tyler Longren
Captain Jack Communications
www.captainjack.com
tyler@captainjack.com