Answers for "php anchor email link"

PHP
0

php anchor email link

//Prevents robots to detect emails

function anchorMailto($email) {
	$output='<script type="text/javascript">';
    $output.="var asdfkjl1=[";
   
    for($i=0;$i<strlen($email);$i++){
        $output.= ord(substr($email,$i,1)).",";
    }
    
    $output = substr($output, 0, -1); 
    $output.= "]";
    
    $output.="
    var newName='';
    for (var i=0; i<asdfkjl1.length; i++)
     newName+=String.fromCharCode(asdfkjl1[i])
    document.write('<a href=\"mailto:'+newName+'\">'+newName+'</a>')
    </script>";
    
    return $output;
}
Posted by: Guest on July-29-2020

Browse Popular Code Answers by Language