$foo = "test.gif";
$foo1 = substr($foo, 0, strpos($foo, "."));
this should work :)
gregor
""Tait Grove"" <[EMAIL PROTECTED]> wrote in message
002a01c07ff7$0dffee20$[EMAIL PROTECTED]">news:002a01c07ff7$0dffee20$[EMAIL PROTECTED]...
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]