Skip to content

Poop Code

  • Home
  • Linux

How to mask phone number in PHP?

October 30, 2024 by poopcode
$data = '+11234567890';

if(  preg_match( '/^\+\d(\d{3})(\d{3})(\d{4})$/', $data,  $matches ) )
{
    $result = $matches[1] . '-' .$matches[2] . '-' . $matches[3];
    return $result;
}
Categories Linux
Add JWT Authentication to your Swagger API docs
How to change background color in Python turtle?
© 2025 Poop Code • Built with GeneratePress