通过php和Javascript隐藏垃圾邮件发送者的电子邮件(正在测试中)

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了通过php和Javascript隐藏垃圾邮件发送者的电子邮件(正在测试中)相关的知识,希望对你有一定的参考价值。

  1. <?php
  2. function hide_from_spam($Email='[email protected]'){
  3. $Email = str_replace('@', '&#64;', $Email);
  4. $Email = str_replace('.', '&#46;', $Email);
  5. $Email = str_split($Email, 4);
  6.  
  7. // Print email using javascript
  8. $anti_spam = '<script type="text/javascript">';
  9. foreach($Email as $write_email){
  10. $anti_spam .= "document.write('$write_email');";
  11. }
  12. $anti_spam .= '</script>';
  13.  
  14. return $anti_spam;
  15. }
  16.  
  17. echo hide_from_spam('[email protected]');
  18.  
  19. ?>

以上是关于通过php和Javascript隐藏垃圾邮件发送者的电子邮件(正在测试中)的主要内容,如果未能解决你的问题,请参考以下文章