tags:

views:

80

answers:

1

I want to get the first bit of the string after the occurrence of the needle like this...

$user = strstr('[email protected]', '@', true);

But this only works with PHP Version 5.3.0, I have 5.2.9 Is there a way I can get the same results?

+3  A: 
list($user, $therest) = explode('@',$email);
dnagirl
Thanks, worked like a charm!
Imran
I was going to suggest `strpos` with `strstr`, but then I saw how much this answer was *already* putting my suggestion to shame.
Carson Myers