RE: [PHP-WIN] Simple string function help needed
| From: | Ross Fleming | Date: | Fri, 03 May 2002 01:20:37 +0000 |
| Subject: | RE: [PHP-WIN] Simple string function help needed | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-13501@lists.php.net to get a copy of this message | ||
Here you go:
$string = substr($string, 0, -4);
Ross
-----Original Message-----
From: RS Herhuth [mailto:ronherhuth@mindspring.com]
Sent: 04 May 2001 02:06
To: php-windows@lists.php.net
Subject: [PHP-WIN] Simple string function help needed
List,
This is an easy one but I'm under the gun and need some help.
I have a situation where I need to trim the last four elements of a string
off from a variable.
Examples of what the string will look like(teses are known, trusted values
and won't change):
$string = "Atlanta CEO"
$string = "Los Angeles CFO"
What I need to do is strip the last four characters off of each string so
that I'm just returning the city, not the group (CFO, CIO, COO etc.)
How do I do this in PHP?
Thanks in advance!
Ron
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php