php實現URL加密解密的方法_PHP技巧_積木網(gimoo.net) var artID=\'399450\',artSID=\'15\',artBBS=\'2\'; jQuery(function($){ $(\'pre\').each(function(i){ if ($(this).find(\'code\').length==0) $(this).html(\"">

成人精品一区二区三区中文字幕-成人精品一区二区三区-成人精品一级毛片-成人精品亚洲-日本在线视频一区二区-日本在线视频免费

導航首頁 ? 技術教程 ? php實現URL加密解密的方法
全站頭部文字 我要出現在這里
php實現URL加密解密的方法 771 2024-01-10   

本文實例講述了php實現URL加密解密的方法。分享給大家供大家參考,具體如下:

<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<meta http-equiv="content-language" content="zh-CN" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="MSThemeCompatible" content="Yes" />
<meta http-equiv="imagetoolbar" content="no" />
<meta http-equiv="widow-target" content="_top" />
<meta name="robots" content="index, follow" />
<meta name="author" content="3945, [email]ljm77@km169.net[/email]" />
<meta name="keywords" content="" />
<meta name="description" content="" />
<meta name="copyright" content="Copyright 3945 All Rights Reserved" />
<title>無標題文檔</title>
<style type="text/css">
<
a, a:link{text-decoration: none; color:#000000; font-size:9pt;}   a:visited{text-decoration: none; color:#000000;}   a:hover{text-decoration: underline; color:red;}
body, td, p, li, div, select{font-size:9pt; font-family:"宋體";}
-->
</style>
</head>
<body>
<?php
function query_encode($sQuery)
{//加密鏈接
  if(strlen($sQuery)==0)
   {
     return '';
   }
   else
   {
    $s_tem = preg_replace("/&/i", '&', $sQuery);
    $s_tem = preg_replace("/&/i", '&', $s_tem);
    $a_tem = explode('&', $s_tem);
    shuffle($a_tem);
    $s_tem = implode('&', $a_tem);
    $s_tem = rawurlencode($s_tem);
    $s_tem = base64_encode($s_tem);
    $s_tem = strrev($s_tem);
     return $s_tem;
   }
}
function query_decode($sEncode)
{//解密鏈接
  if(strlen($sEncode)==0)
   {
     return '';
   }
   else
   {
    $s_tem = strrev($sEncode);
    $s_tem = base64_decode($s_tem);
    $s_tem = rawurldecode($s_tem);
     return $s_tem;
   }
}
function rebuild_GET()
{//重寫$_GET全局變量
  $_GET = array();
  $s_query = $_SERVER['QUERY_STRING'];
   if(strlen($s_query)==0)
   {
     return;
   }
   else
   {
    $s_tem = query_decode($s_query);
    $a_tem = explode('&', $s_tem);
     foreach($a_tem as $val)
     {
      $tem = explode('=', $val);
      $_GET[$tem[0]] = $tem[1];
     }
   }
}
rebuild_GET();
echo 'GET:<pre>'.print_r($_GET, true).'</pre>';
function testGET()
{
   echo 'Function GET:<pre>'.print_r($_GET, true).'</pre>';
}
testGET();
?>
<br /><br /><br />
<?
for($i=1; $i<10; $i++)
{
  $s_url = query_encode('ac=index:logo& style="color: #007700">.$i);
   echo sprintf('<a >TEST: %s</a><br />', $s_url, $s_url);
}
?>
</body>
</html>

PS:關于加密解密感興趣的朋友還可以參考本站在線工具:

URL網址16進制加密工具:
http://tools.gimoo.net/password/urlencodepwd

密碼安全性在線檢測:
http://tools.gimoo.net/password/my_password_safe

高強度密碼生成器:
http://tools.gimoo.net/password/CreateStrongPassword

MD5在線加密工具:
http://tools.gimoo.net/password/CreateMD5Password

迅雷、快車、旋風URL加密/解密工具:
http://tools.gimoo.net/password/urlrethunder

在線散列/哈希算法加密工具:
http://tools.gimoo.net/password/hash_encrypt

更多關于PHP相關內容感興趣的讀者可查看本站專題:《php加密方法總結》、《PHP編碼與轉碼操作技巧匯總》、《php面向對象程序設計入門教程》、《PHP數學運算技巧總結》、《PHP數組(Array)操作技巧大全》、《php字符串(string)用法總結》、《PHP數據結構與算法教程》、《php程序設計算法總結》、《php正則表達式用法總結》、及《php常見數據庫操作技巧匯總》

希望本文所述對大家PHP程序設計有所幫助。



主站蜘蛛池模板: 二胡独奏北国之春| 《画江湖之不良人》| 李子京| 连城诀1-40集全集免费| 我和我的祖国教案| 黑帮大佬和我的第365天| 黄造时个人简历| 处女巫| 贝克| abo血型鉴定实验报告| bbbbbbbbb免费毛片视频| 莴笋是发物吗| 巧巧| 抗日电影免费| 国内性爱视频| 视力图| 捉迷藏剧情全解析| 桥段| 电影《追求》| 施华| 直播惊魂夜| 女人高潮私密按摩视频| 行则将至上一句| 邵雨薇电影| 林正英僵尸先生电影在线观看| 金珉奎怎么读| 九号所有车型图片| 对你上头了| 干了一个月的家具导购| 路易·德·菲奈斯| 范海辛电影原声在线观看免费| cetv3中国教育电视台直播| 世界上最有杀气的国歌| 孙婉| 甜蜜监狱| 大国崛起思维导图| 卡通动漫图片| 电影《醉猴》刘家良主演| 李顺大造屋| 创新点| 正在直播乒乓赛事|

!!!站長長期在線接!!!

網站、小程序:定制開發/二次開發/仿制開發等

各種疑難雜癥解決/定制接口/定制采集等

站長微信:lxwl520520

站長QQ:1737366103