Oihana Php Masking

maskEmail.php

Table of Contents

Functions

maskEmail()  : string
Replaces a value with a random, non-routable email address.

Functions

maskEmail()

Replaces a value with a random, non-routable email address.

maskEmail([mixed $value = null ]) : string

Implements the conventional email masker: the result has the shape AAAA.BBBB@CCCC.invalid with random parts. The original value is never reflected in the output (the content is replaced wholesale, not hashed reversibly), so it is safe for anonymization. The .invalid TLD is reserved (RFC 2606) and never resolves.

Parameters
$value : mixed = null

The original value (ignored — replaced wholesale).

Tags
throws
RandomException
example
use function oihana\masking\maskEmail;

maskEmail( 'real.person@example.com' ); // e.g. "x7Bq.9aMz@Kp3R.invalid"
since
1.0.0
author

Marc Alcaraz

Return values
string

The anonymized email address.

On this page

Search results