anonymize emails texts names

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    anonymize emails texts names

    this function anonymizes emails and names etc
    PHP Code:
    <?php
    function anonymize($text='',$char_num=3)
    {
        for(
    $i==0;$i<strlen($text);$i++)
        {
            if((
    $i $char_num)==0&&ctype_alnum($text[$i]))
                
    $new_text .= '*';
            else
                
    $new_text .= $text[$i];
            
        }
        return 
    $new_text;
    }

    ?>
    usage
    PHP Code:
    $email 'someemail@gmail.de';
    echo 
    anonymize($email,4); 
    output:
    Code:
    *ome*mai*@gm*il.*e
    Advertise your mobile site for FREE with AdTwirl

Working...
X