dongshi4589 2015-12-25 17:22
浏览 37
已采纳

从yii2中的电子邮件地址中提取数字部分

I have an email address format like this - st15103@live.tees.ac.uk what i want to do is extract the ID part of this email like this - st15103 How can i do this using PHP string function ?

  • 写回答

2条回答 默认 最新

  • dppcyt6157 2015-12-25 17:24
    关注

    Just split on @ and get the first part ?

    $id = array_shift( explode("@", " - st15103@live.tees.ac.uk") );
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?