but you would have to count how many dots are there ...

-----Original Message-----
From: Gregor [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 17, 2001 5:20 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] string replace


$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]

-- 
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]

Reply via email to