易截截图软件、单文件、免安装、纯绿色、仅160KB

迅速学会PHP加密解密技巧

闲话少说,先将它们打包成一个文件就叫fun.php吧
< ?php  
function passport_encrypt($txt, $key) {  
srand((double)microtime() * 1000000);  
$encrypt_key = md5(rand(0, 32000));  
$ctr = 0;  
$tmp = '';  
for($i = 0;$i < strlen($txt); $i++) {  
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;  
$tmp .= $encrypt_key[$ctr].($txt[$i]
 ^ $encrypt_key[$ctr++]);  
}  
return base64_encode(passport_key($tmp, $key));  
}  
function passport_decrypt($txt, $key) {  
$txt = passport_key(base64_decode($txt), $key);  
$tmp = '';  
for($i = 0;$i < strlen($txt); $i++) {  
$md5 = $txt[$i];  
$tmp .= $txt[++$i] ^ $md5;  
}  
return $tmp;  
}  
function passport_key($txt, $encrypt_key) {  
$encrypt_key = md5($encrypt_key);  
$ctr = 0;  
$tmp = '';  
for($i = 0; $i < strlen($txt); $i++) {  
$ctr = $ctr == strlen($encrypt_key) ? 0 : $ctr;  
$tmp .= $txt[$i] ^ $encrypt_key[$ctr++];  
}  
return $tmp;  
}  
?> 
以下是一些示例…加深对这三个PHP加密解密函数的理解…
 
//string.php  < ?php  include “fun.php”;  $txt = “This is a test”;  $key = “testkey”;  $encrypt = passport_encrypt($txt,$key);  $decrypt = passport_decrypt($encrypt,$key);  echo $txt.”< br>< hr>”;


相关文档:

PHP rsync命令介绍

rsync 是一款高效的远程数据备份和镜象工具,可快速地同步多台主机间的文件,其具有如下特性:
支持链接、所有者、组信息以及权限信息的拷贝;
通过远程 shell(ssh, rsh)进行传输;
无须特殊权限即可安装使用;
流水线式文件传输模式,文件传输效率高;
支持匿名操作;
通过远程 shell 方式:
rsync [OPTION] [USE ......

php 程序的国际化gettext

步骤一:搭建环境
1,首先查看你的php扩展目录下是否有php_gettext.dll这个
文件,如果没有,这就需要你
下载一个或是从其他地方拷贝一个,然后放到php扩展目录。
2,打开php.ini,查
找”;extension=php_gettext.dll“ ,然后去除注释,重启apache。
步骤二:原理讲解
假如你的没
有国际化的程序里有这样 ......

php Mod rewrite test

In the directory where you plan to install Elgg, do the following:
Create the file .htaccess and add these two lines
RewriteEngine on
RewriteRule ^testing.php$ modrewrite.php
This tells the webserver to load modrewrite.php when testing.php is
requested.
In order to get this test to work on ......

php下通过xml_parse解析xml文件

xml_parse解析xml文件时候,
很有可能不仅仅调用一次character_handler。
所以在获得xml节点的文本信息的时候,要用连接运算".="。
参考 http://jp2.php.net/manual/ro/function.xml-set-character-data-handler.php
ken at positive-edge dot com
30-Jan-2002
01:20
the function handler is called ......

PHP 正则表达式查找字符串

<?php
set_time_limit(0);
$url='http://item.taobao.com/auction/item_detail.htm?xid=0db2&item_num_id=4512430274&cm_cat=50000671&pm2=1';
$ch = curl_init();
$timeout = 10;
curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CU ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号