Re: Need to delete charcters from a string
| From: | Joe Van Meer | Date: | Tue, 05 Feb 2002 00:55:11 +0000 |
| Subject: | Re: Need to delete charcters from a string | ||
| References: | 1 2 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-16651@lists.php.net to get a copy of this message | ||
Why couldn't you use something like this:
$mystr = substr($mystr, -3);
Joe
Jeroen Timmers <jeroen@start4me.nl> wrote in message
news:003001c1b026$97373cb0$7f6440d4@jeroen...
> you can take the function substr from php in combination with strlen
(lenght
> of a string)
>
> example
>
> $string = "1234567890";
> $rest = substr($string, 0, strlen($string)-3); // returns "1234567"
>
> Success Jeroen Timmers
>
>
> ----- Original Message -----
> From: "Renaldo De Silva" <cirkit_tt@yahoo.com>
> To: <php-db@lists.php.net>; <php-general@lists.php.net>
> Sent: Thursday, February 07, 2002 8:56 PM
> Subject: [PHP-DB] Need to delete charcters from a string
>
>
> > I need to delete the last 3 character of a string, what command can i
use
> o
> > do this.
> >
> > --
> > PHP Database Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>