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);
> >
> >
> -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
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
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
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
;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
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
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
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
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 ><>
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
I have a string that ends in a comma. What is best method to remove the
comma?
Craig ><>
[EMAIL PROTECTED]
12 matches
Mail list logo