Pastetool #297

URL: , Paste another

<?php
	// Adds masking on different strings, for example email@gmail.com will become e****@gmail.com
	
	function mask_email($v){
		if(! $v){return'';}
		$p = split('@',$v);
		$p[0] = substr($p[0],0,1).str_repeat('*',strlen($p[0])-1);
		return join('@',$p);
	}
	function mask_ip($v){
		if(! $v){return'';}
		$p = split('\.',$v);
		$p[count($p)-1]='***';
		return join('.',$p);
	}
	function mask_str($v){
		if(! $v){return'';}
		$p = substr($v,0,1).str_repeat('*',strlen($v)-1);
		return $p;
	}
?>

Download code

This php code was pasted on February 3, 2010




Protected with advance Anti-SPAM techniques :)
Coded and designed by Fedmich
Follow us on Twitter