Strstr show string before appearance

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

$user = strstr('someemail@yahoo.com', '@', true); 

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

+3
source share
1 answer
list($user, $therest) = explode('@',$email);
+9
source

Source: https://habr.com/ru/post/1719323/


All Articles