RE: [PHP] string replace
| From: | Maxim Maletsky | Date: | Wed, 17 Jan 2001 01:44:48 +0000 |
| Subject: | RE: [PHP] string replace | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-34955@lists.php.net to get a copy of this message | ||
but you would have to count how many dots are there ...
-----Original Message-----
From: Gregor [mailto:gre-gor@delphi-si.com]
Sent: Wednesday, January 17, 2001 5:20 AM
To: php-general@lists.php.net
Subject: Re: [PHP] string replace
$foo = "test.gif";
$foo1 = substr($foo, 0, strpos($foo, "."));
this should work :)
gregor
""Tait Grove"" <taitg@digitalimagination.com> wrote in message
news:002a01c07ff7$0dffee20$8dd0b2cf@iswest.com...
How can I strip everything past a certain character in a string?
i.e.:
$foo = "test.gif";
// strip past the .gif
$foo = "test";
// again
$foo2 = "test.jpeg";
// strip past the .jpeg
$foo2 = "test";
Tait
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net