设为首页收藏本站淘宝杂货铺

从F到0 - From F to 0

 找回密码
 注册已关闭
搜索
查看: 2682|回复: 0
收起左侧

[PHP/ASP/JSP] PHP将URL大小写随机打乱实现判断一个超链接是否伪静态 (不一定准确,返回TRUE或FALSE)

[复制链接]
发表于 2019-12-14 10:53:54 | 显示全部楼层 |阅读模式
  1. <?php
  2. function letter_upset($text){
  3.         $len = strlen($text)-1;
  4.         do {
  5.                 $ascii = ord($text[$len]);
  6.                         if(rand(0,1)) continue;
  7.                                 if($ascii >= 65 && $ascii <= 90){
  8.                                         $ascii+=32;
  9.                                 } elseif($ascii >= 97 && $ascii <= 122){
  10.                                         $ascii-=32;
  11.                         }

  12.                         
  13.                 $text[$len] = chr($ascii);

  14.         } while($len--);
  15.         return $text;
  16. }


  17. function is_htaccess($url){
  18.         return (@file_get_contents($url) && !strlen(@file_get_contents(letter_upset($url)))) ? TRUE : FALSE;
  19. }

  20. echo is_htaccess('https://www.fedcba9876543210.com/thread-3227-1-1.html') ? 'Yes' : 'No';
  21. echo is_htaccess('https://www.fedcba9876543210.com/forum.php') ? 'Yes' : 'No';
  22. echo is_htaccess('https://www.fedcba9876543210.com/favicon.ico') ? 'Yes' : 'No';

  23. ?>
复制代码

相关帖子

您需要登录后才可以回帖 登录 | 注册已关闭

本版积分规则

QQ|手机版|Archiver|从F到0 ( 蒙ICP备17002595号-1 )
蒙公网安备15010402000325号

腾讯云安全认证

GMT+8, 2024-4-24 20:46 , Processed in 0.675038 second(s), 20 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表