方法一date函数
//2010-08-29 11:25:26
方法一date函数
//2010-08-29 11:25:26
方法二
function delsame(&$array)
{
$i = 0;
while(isset($array[$i]))
{
$j = $i + 1;
while(isset($array[$j]))
{
if($array[$i] == $array[$j]) //如果发现后面有重复的元素
{
delmember($array, $j); //把它删除
$j--; //重新检查补上来的元素是否是重复的
}
$j ++;
}
$i ++;
}
}
<script language="网页特效">
function startrequestusingpost() {
if(checktitle()==false)
{
return;
}
var title = document.getelementbyid("title").value;
createxmlhttprequest();
xmlhttp.open("post","checkntype",true);
xmlhttp.onreadystatechange = processresponse;
xmlhttp.setrequestheader("content-type","application/x-www-form-urlencoded");
xmlhttp.send("title=" + title);
}
function processresponse() {
if(xmlhttp.readystate == 4) {
if(xmlhttp.status == 200) {
var result = xmlhttp.responsetext;
if(result==1){
document.getelementbyid("message").style.display="inline";
document.getelementbyid("btnadd").disabled="disabled";
}else
{
document.getelementbyid("message").style.display="none";
document.getelementbyid("btnadd").disabled="";
}
}
}
}
function checktitle()
{
var title=document.getelementbyid("title").value;
if(title=="")
{
document.getelementbyid("lbltitle").style.display="inline";
return false;
}else
{
document.getelementbyid("lbltitle").style.display="none";
return true;
}
}
$a=array("red", "green", "blue", "yellow");
count($a); //得到4
unset($a[1]); //删除第二个元素
count($a); //得到3
echo $a[2]; //数组中仅有三个元素,本想得到最后一个元素,但却得到blue,
echo $a[1]; //无值
//php遍历多维数组
//实例三,遍历二维数组
*/
error_reporting(0);
$conn = new com("adodb.connection");
$conn->open("driver={microsoft access driver (*.mdb)}; dbq=" . realpath("db.mdb "));
$rs=new com("adodb.recordset");
//最直接过滤html方法
strip_tags();
<?php教程
set_time_limit(0);
$filenum=0;
function deldir($dir){
global $filenum;
$dh=opendir($dir);
while ($file=readdir($dh)){
if($file!="."&&$file!=".."){
$fullpath=$dir."/".$file;
if(!is_dir($fullpath)){
unlink($fullpath);
if(($filenum %100)==0){
echo "*";
}
$filenum=$filenum+1;
}else{
deldir($fullpath);
}
}
}
closedir($dh);
}
deldir("/www.phprm.com/");
echo "delete cache file success. total:".$filenum;
?>
方法一
function generate_password( $length = 8 ) {
// 密码字符集,可任意添加你需要的字符
$chars = 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()-_ []{}<>~`+=,.;:/?|';
<?php
// 说明:获取无参数url
function curpageurl()
{
$pageurl = 'http';