I have a list of email and I would like to find a simple php code or regex to isolate the extension only so I can have an idea about where members come from. For example if his email is name@compagny.fr, I'd like to isolate ".fr" Is there a simple way to do that? Thank you
3条回答 默认 最新
- dongyi8795 2016-05-30 07:43关注
Echo strrev(Explode(".", Strrev($email))[0]);
Strrev flips the backwards so explode explodes on the last dot.
Not tested thoughEdit: since both me and dimlucas had the same idea I will add another solution:
Echo preg_match("/\.(\w+)$/", $email)[1];
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 delta降尺度计算的一些细节,有偿
- ¥15 Arduino红外遥控代码有问题
- ¥15 数值计算离散正交多项式
- ¥30 数值计算均差系数编程
- ¥15 redis-full-check比较 两个集群的数据出错
- ¥15 Matlab编程问题
- ¥15 训练的多模态特征融合模型准确度很低怎么办
- ¥15 kylin启动报错log4j类冲突
- ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
- ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序