📜  如何在php代码示例中屏蔽电话号码

📅  最后修改于: 2022-03-11 14:54:38.545000             🧑  作者: Mango

代码示例1
$data = '+11234567890';

if(  preg_match( '/^\+\d(\d{3})(\d{3})(\d{4})$/', $data,  $matches ) )
{
    $result = $matches[1] . '-' .$matches[2] . '-' . $matches[3];
    return $result;
}