php中常用函数技巧
1.随机字符序列生成函数:
<?php
//用于验证码序列生成等..
function random($length) {
$hash = '';
$chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789abcdefghijklmnopqrstuvwxyz';
$max = strlen($chars)-1;
$length=4;//长度自行设定
mt_srand((double)microtime() * 1000000);
for($i = 0; $i < $length; $i++){
$hash .= $chars[mt_rand(0, $max)];
}
return $hash;
}
//测试输出:
//echo random(4);
?>
相关文档:
<?php
/*使用文本文件记录数据的简单实现*/
$counter=1;
if(file_exists("mycounter.txt")){
$fp=fopen("mycounter.txt","r");
$counter=fgets($fp,9);
$counter++;
fclose($fp);
}
$fp=fopen("mycounter.txt","w");
fputs($fp,$counter);
fclose($fp);
echo "<h1>您是第".$counter."次访问本页 ......
//创建文件夹的方法
//$path 为文件夹参数,如 (c:/program files/makedir)
function createFolders($path) {
if (!file_exists($path)) {
$this->createFolders(dirname($path));
mkdir($path, 0777);
&n ......
PHP Security for Deployers
If you're a Developer
READ THIS and then work with your SysAdmins to step through any and all the layers of security designed to protect your apps.
Example:
Traffic must first pass through a SPI firewall (ensure that ONLY necessary ports/protocols are permitted; en ......
本套视频教程为高清视频教程!请全屏观看!本套视频教程讲的比较简单,主要讲了Apache服务器的下载和安装,mysql数据库的简单操作等等,还讲了聊天室设计
,留言板,会员管理系统,投票管理系统,图书管理系统,产品进销存管理系统几个实例,都比较简单,所以这套视频教程适合新手学习。高手也可以参考看下!
地址:http ......