Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有电子邮件格式
iba@test.com
预期产出
@test.com
我需要删除邮件 ID 之后的名称我该怎么做我已经尝试过 str_replace 但这并没有给我一个解决方案。
使用爆炸
$email= "iba@test.com" $domain= explode("@",$email); echo $domain[0]; // iba echo $domain[1]; //test.com
请尝试这样:
let string = "iba@test.com" const result = `@${string.split('@')[1]}`