RE: [PHP] How to chop off a char off end?
| From: | Matthew DeChant | Date: | Fri, 27 Apr 2001 20:54:53 +0000 |
| Subject: | RE: [PHP] How to chop off a char off end? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-50698@lists.php.net to get a copy of this message | ||
$x = "yourtexthere.";
$x = substr($x, 0, -1);
$x will then equal = "yourtexthere"
-m
-----Original Message-----
From: Dexter [mailto:dcoelho@weginc.com]
Sent: Friday, April 27, 2001 6:45 PM
To: php-general@lists.php.net
Subject: [PHP] How to chop off a char off end?
Using Perl , I usually say
$string=~s /,$//;
to chop off a particualr char on end.
How do you do this using PHP.
Thanks,
Dexter