Re: [PHP] remove last character in a string

2002-04-23 Thread Evan Nemerson
yler Longren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> > Sent: Monday, April 22, 2002 10:53 PM > Subject: Re: [PHP] remove last character in a string > > > Why get strlen involved??? > > > > $string = substr("$string", 0, -1); > > > >

RE: [PHP] remove last character in a string

2002-04-23 Thread Ford, Mike [LSS]
> -Original Message- > From: Evan Nemerson [mailto:[EMAIL PROTECTED]] > Sent: 23 April 2002 04:54 > > Why get strlen involved??? > > $string = substr("$string", 0, -1); Why get quotes involved??? $string = substr($string, 0, -1); Cheers! Mike

FW: [PHP] remove last character in a string

2002-04-22 Thread Jarrad Kabral
002 1:57 PM To: Evan Nemerson; [EMAIL PROTECTED] Subject: Re: [PHP] remove last character in a string Because I'm kinda stupid. :) tyler - Original Message - From: "Evan Nemerson" <[EMAIL PROTECTED]> To: "Tyler Longren" <[EMAIL PROTECTED]>; <[EMA

RE: [PHP] remove last character in a string

2002-04-22 Thread Matthew Walker
erman; php-general-list Subject: Re: [PHP] remove last character in a string 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 [EMAIL

Re: [PHP] remove last character in a string

2002-04-22 Thread Tyler Longren
Because I'm kinda stupid. :) tyler - Original Message - From: "Evan Nemerson" <[EMAIL PROTECTED]> To: "Tyler Longren" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]> Sent: Monday, April 22, 2002 10:53 PM Subject: Re: [PHP] remove last charac

Re: [PHP] remove last character in a string

2002-04-22 Thread Tyler Longren
;Tyler Longren" <[EMAIL PROTECTED]> Cc: "Craig Westerman" <[EMAIL PROTECTED]>; "php-general-list" <[EMAIL PROTECTED]> Sent: Tuesday, April 23, 2002 12:04 AM Subject: Re: [PHP] remove last character in a string > No you don't. You should go read the sub

Re: [PHP] remove last character in a string

2002-04-22 Thread Rasmus Lerdorf
Rasmus mentioned. > > Tyler Longren > Captain Jack Communications > www.captainjack.com > [EMAIL PROTECTED] > > - Original Message - > From: "Craig Westerman" <[EMAIL PROTECTED]> > To: "php-general-list" <[EMAIL PROTECTED]> > Sent: Mond

Re: [PHP] remove last character in a string

2002-04-22 Thread Evan Nemerson
Why get strlen involved??? $string = substr("$string", 0, -1); -- He is richest who is content with the least, for content is the wealth of nature. Socrates -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] remove last character in a string

2002-04-22 Thread Craig Westerman
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 ><> [EMAIL PROTECTED] First, you'll need to get the length of the str with the str_len() function. After you have that, use

Re: [PHP] remove last character in a string

2002-04-22 Thread Tyler Longren
n" <[EMAIL PROTECTED]> To: "php-general-list" <[EMAIL PROTECTED]> Sent: Monday, April 22, 2002 10:26 PM Subject: [PHP] remove last character in a string > I have a string that ends in a comma. What is best method to remove the > comma? > > Craig ><>

Re: [PHP] remove last character in a string

2002-04-22 Thread Rasmus Lerdorf
read php.net/substr On Mon, 22 Apr 2002, Craig Westerman wrote: > I have a string that ends in a comma. What is best method to remove the > comma? > > Craig ><> > [EMAIL PROTECTED] > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] remove last character in a string

2002-04-22 Thread Craig Westerman
I have a string that ends in a comma. What is best method to remove the comma? Craig ><> [EMAIL PROTECTED]