strstr在出现之前显示字符串 [英] strstr to show string before occurance

查看:97
本文介绍了strstr在出现之前显示字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在出现针后得到字符串的第一位...

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

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

但是这仅适用于PHP版本5.3.0,我有5.2.9 有什么方法可以得到相同的结果吗?

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?

推荐答案

list($user, $therest) = explode('@',$email);

这篇关于strstr在出现之前显示字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆