Re: string replace
| From: | Gregor | Date: | Tue, 16 Jan 2001 20:20:11 +0000 |
| Subject: | Re: string replace | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-34896@lists.php.net to get a copy of this message | ||
$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