如何在 php/mysql 中从电子邮件地址中提取网站名称。 在这里爆炸太昂贵了,因为我必须对 db 中的数千个数据进行爆炸
original data
test@example.com
test@example1.com
needed data
example.com
example1.com
最佳答案
function getDomain( $email ) {
return substr( $email, strpos( $email, '@' ) + 1 );
}
$website = getDomain( 'test@example.com' );
关于php - 在php中从电子邮件地址抓取网站,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10837099/