Re: last three characters of a string
| From: | David Robley | Date: | Tue, 10 Apr 2001 02:56:10 +0000 |
| Subject: | Re: last three characters of a string | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-47927@lists.php.net to get a copy of this message | ||
On Tue, 10 Apr 2001 12:18, Joseph Bannon wrote:
> I need to examine the last 3 characters of a string. Is there code that
> does that?
>
> J
You can extract them with substr - there are examples in the docs which
demonstrate the use of negative start parameters to work backwards from
the end of a string. You might want to trim the string first if you don't
want any whitespace of EOL characters.
--
David Robley | WEBMASTER & Mail List Admin
RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/
AusEinet | http://auseinet.flinders.edu.au/
Flinders University, ADELAIDE, SOUTH AUSTRALIA