dedecms分词系统调用代码

 更新时间:2016年11月25日 16:27  点击:1868
这里你可以下载dedecms然后找到lib_splitword_full.php这个文件,或者到http://down.111cn.net下载分词包,按照下面的方法就可以正确的使用dedecms的分词系统了。

require("lib_splitword_full.php");

$str = "一线楼市交易清淡";


$t1 = exectime();

$sp = new splitword();

$t2 = exectime();

//$t0 = $t2-$t1;

//echo "载入时间: $t0 <br><br>";


echo $sp->findnewword($sp->splitrmm($str))."<hr>";
echo $sp->splitrmm($str)."<hr>";

$sp->clear();

echo $str."<br>";

$t3 = exectime();
$t0 = $t3-$t2;
echo "<br>处理时间: $t0 <br><br>";


function exectime(){
 $time = explode(" ", microtime());
 $usec = (double)$time[0];
 $sec = (double)$time[1];
 return $sec + $usec;
}

php 递归删除目录(文件夹)下面举了两个实例,一个是删除单独的空目录代码,一个是批量删除目录文件夹的代码。

//删除单个空文件夹

 代码如下 复制代码

$dir = 'www.111cn.net';
if( is_dir( $dir ) ) //判断是否为目录
{
 if( rmdir( $dir ) )
 {
  echo '目录删除成功';
 }
 else
 {
  echo '没有删除目录的权限';
 }
}
else
{
 echo '不是一个有效的目录';
}

//下面来看一个批量递归删除目录的函数吧。

 代码如下 复制代码
function deletedir($dir){
      if(!handle=@opendir($dir)){     //检测要打开目录是否存在
               die("没有该目录");
      }
     while(false !==($file=readdir($handle))){
               if($file!=="."&&$file!==".."){       //排除当前目录与父级目录
                            $file=$dir .directory_separator. $file;
                            if(is_dir($file)){
                                  deletedir($file);
                            }else{
                                  if(@unlink($file)){
                                         echo "文件<b>$file</b>删除成功。<br>";
                                  }else{
                                          echo  "文件<b>$file</b>删除失败!<br>";
                                 }
                }
     }
    if(@rmdir($dir)){
           echo "目录<b>$dir</b>删除成功了。<br> ";
    }else{
           echo "目录<b>$dir</b>删除失败!<br> ";
  }
}
 


//测试程序
$dir="/var/www/test";
deletedir($dir);

这是一款利用php 与mysql数据库实现的用户注册与登录代码哦,功能也是比较简单实用的用户注册程序哦。同时也加了用户登录时验证码程序,这样做就安全了很多哦。
 代码如下 复制代码

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>在后台增加用户</title>
</head>

<body>

<?php
 require_once("config.php");
   if(isset($_post["submit2"])){
   mysql_select_db('a0807000225'); //这个是数据库表
   $author=$_session["user_name"];
   define(all_ps教程,"jinquan");
   echo $username=$_post["username"];
   echo $password=md5($password=$_post["password"].all_ps);
   echo "</br>";
   if($username){
   if($password){
      $str = "insert into `dx_user_list` ( `uid` , `m_id` , `username` , `password` ) values (ascii( null ) , '1', '$username', '$password');";
   $rs=mysql_query($str,$conn);
   mysql_close($conn);
  }
  if($rs){
    echo"<script>alert('新增成功');location.href='yonghuzc.php'</script>";
    }else{
    echo"<script>alert('新增失败');location.href=''yonghuzc.php'</script>";
    }
  }
 }

?>

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate">
<title>ajax+php教程文件管理系统</title>
<style type="text/css教程">
@charset "utf-8";
/* css document */
<!--
body {
 padding-right: 0px;
 padding-left: 0px;
 padding-bottom: 0px;
 margin: 0px auto;
 color: #777;
 line-height: 18px;
 padding-top: 0px;
 font-family: tahoma, arial, helvetica, sans-serif;
 background-color: #fff
}
*+html body {
 padding-right: 0px;
 padding-left: 0px;
 padding-bottom: 0px;
 margin: 0px auto;
 color: #777;
 line-height: 18px;
 padding-top: 0px;
 font-family: "微软雅黑", ahoma, arial, helvetica, sans-serif;
 background-color: #fff
}
a {
 text-decoration:none
}
input {
 padding-right: 0px; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px
}
.main {
 background-color:#bfe6bc;
 margin:100px auto;
 width:800px;
 height:180px;
 border:8px #399c26 solid;
}
.header {
 text-align:center;
 margin:10px auto;
 width:100%;
 display:block
}
.header h1 {
 font-size:20px;
 color:#399c26
}
.header p {
 padding:0px;
 margin-top:-10px;
}
.header p span{
 font-size:12px;
 color:#fff
}
.button_list {
    margin:10px auto;
 width:382px;
 height:110px;
 display:block
}
.button {
 width:100px;
 border:8px #399c26 solid;
 height:20px;
 line-height:20px;
 font-size:14px;
 float:left;
 text-align:center;
 margin-left:10px;
 margin-bottom:10px;
 background-color:#399c26
}
.button a{
 color:#fff;
 font-weight:bold
}
.footer {
 text-align:center;
 font-size:12px;
 display:block;
 margin:10px auto;
}
.black_overlay{
 display: none;
 position: absolute;
 top: 0%;
 left: 0%;
 width: 100%;
 height: 100%;
 background-color: black;
 z-index:1001;
 -moz-opacity: 0.8;
 opacity:.80;
 filter: alpha(opacity=80);
}
.file_list {
 display: none;
 position: absolute;
 top: 25%;
 left: 25%;
 width: 50%;
 height: 50%;
 padding: 16px;
 border: 8px solid #399c26;
 background-color: white;
 z-index:1002;
 overflow: auto;
 background-color:#bfe6bc;
}
.file_list_t {
 margin:0 auto;
 display:inline;
}
.file_list_t li {
 font-size:14px;
 list-style-type:none;
 padding:0px;
 background-color:#bfe6bc;
 border-bottom:1px #ccc solid;
}
*+html .file_list_t li {
 font-size:14px;
 background:url(images/list_ico_1.gif) #fff no-repeat 7px 50%;
 list-style-type:none;
 text-indent:5px;
 padding:0px;
 background-color:#bfe6bc;
 border-bottom:1px #ccc solid;
}
*+html .file_list_t li span {
 float:right;
 font-weight:bold;
 margin-top:-20px;
}
.file_list_t li span {
 float:right;
 font-weight:bold;
 margin-top:0px;
}
.file_list_t li a{
 color:#399c26;
}
.file_list_close {
 display: none;
 position: absolute;
 top: 22%;
 left: 75%;
 width: 30px;
 height: 16px;
 border: 1px solid #399c26;
 z-index:1002;
 background-color:#399c26;
 color:#fff;
 line-height:16px;
 text-align:center
}
.file_list_close a{
 color:#fff;
}

/* file_content_input_form */
.file_content_input_form{
    margin:0 auto;
    width:450px;
    padding:14px;
}
/* input_box */
#input_box{
}
#input_box h1 {
    font-size:14px;
    font-weight:bold;
    margin-bottom:8px;
}
#input_box p{
    font-size:11px;
    color:#399c26;
    margin-bottom:20px;
    border-bottom:solid 1px #b7ddf2;
    padding-bottom:10px;
}
#input_box label{
    display:block;
    font-weight:bold;
    text-align:right;
    width:140px;
    float:left;
}
#input_box .small{
    color:#399c26;
    display:block;
    font-size:11px;
    font-weight:normal;
    text-align:right;
    width:140px;
}
#input_box input{
    float:left;
    font-size:12px;
    padding:4px 2px;
    border:solid 1px #399c26;
    width:200px;
    margin:2px 0 20px 10px;
}
#input_box textarea{
    float:left;
    font-size:12px;
    padding:4px 2px;
    border:solid 1px #399c26;
    width:200px;
 height:150px;
    margin:2px 0 20px 10px;
}
#input_box button{
    clear:both;
    margin-left:150px;
    width:125px;
    height:31px;
    background:#399c26;
    text-align:center;
    line-height:31px;
    color:#ffffff;
    font-size:11px;
    font-weight:bold;
}
-->


</style>

<script type="text/网页特效" src="ajax.网页特效"></script>

</head>

<body>
<div class="main">
  <div class="header">
    <h1>欢迎使用anfms</h1>
    <p><span>v0.1.0 alpha</span></p>
  </div>
  <div class="button_list">
    <div class="button"><a href="网页特效:void(0);" onclick="javascript:file_list('/');document.getelementbyid('file_list').style.display='block';document.getelementbyid('file_list_close').style.display='block';document.getelementbyid('fade').style.display='block'">文件列表</a></div>
    <div class="button"><a href="javascript:void(0);" onclick="javascript:file_list('/');document.getelementbyid('file_make').style.display='block';document.getelementbyid('file_list_close').style.display='block';document.getelementbyid('fade').style.display='block'">创建文件</a></div>
    <div class="button"><a href="javascript:void(0);" onclick="document.getelementbyid('file_content_input').style.display='block';document.getelementbyid('file_list_close').style.display='block';document.getelementbyid('fade').style.display='block'">写入内容</a></div>
    <div class="button"><a href="javascript:void(0);" onclick="document.getelementbyid('file_get_content').style.display='block';document.getelementbyid('file_list_close').style.display='block';document.getelementbyid('fade').style.display='block'">读取内容</a></div>
  </div>
  <div class="footer">
     <p>
     &copy;2009-2010 uniter.com.cn powered by uniter team<br />
     supported by ie7+ firefox opera
     </p>    
  </div>
 
  <div class="file_list_close" id="file_list_close">
    <a href="javascript:void(0);" onclick="document.getelementbyid('file_list').style.display='none';document.getelementbyid('file_content_input').style.display='none';document.getelementbyid('file_get_content').style.display='none';document.getelementbyid('file_list_close').style.display='none';document.getelementbyid('fade').style.display='none';location.reload()">x</a>
  </div>
  <div class="file_list" id="file_list"></div>
  <div class="file_list" id="file_content_input">
    <div id="input_box" class="file_content_input_form">
    <form id="form" name="form" method="post" action="">
        <label>文件名
           <span class="small">例如:abc.txt</span>
       </label>
       <input type="text" name="input_name" id="input_name" />
       <label>内容值
            <span class="small">添加文件内容</span>
       </label>
       <textarea name="input_content" id="input_content"></textarea>
       <button type="button" onclick="javascript:file_content_input('input_name='+document.getelementbyid('input_name').value+'&input_content='+document.getelementbyid('input_content').value);">确定</button>
       <div class="spacer"></div>
    </form>
    </div>
  </div>
  <div class="file_list" id="file_get_content">
    <div id="input_box" class="file_content_input_form">
    <form id="get_form" name="get_form" method="post" action="">
        <label>文件名
           <span class="small">例如:abc.txt</span>
       </label>
       <input type="text" name="input_name" id="input_name" />      
       <button type="button" onclick="javascript:file_get_content('input_name='+document.get_form.input_name.value);">确定</button>
       <div class="spacer"></div>
    </form>
    </div>
  </div>
  <div class="file_list" id="file_make">
    <div id="input_box" class="file_content_input_form">
    <form id="make_form" name="make_form" method="post" action="">
        <label>文件夹
           <span class="small">例如:abc</span>
       </label>
       <input type="text" name="input_name" id="input_name" />      
       <button type="button" onclick="javascript:file_make('input_name='+document.make_form.input_name.value);">确定</button>
       <div class="spacer"></div>
    </form>
    </div>
  </div>
  <div id="fade" class="black_overlay"></div>
</div>
</body>
</html>

ajax.网页特效

<script>
// javascript document
function do_ajax() {   
}
function ajax_get_data(id) { 
}
function file_list(path) { 
    var xhr;
 if (window.xmlhttprequest) {
  xhr = new xmlhttprequest();
 }else if (window.activexobject) {
  xhr = new activexobject("msxml2.xmlhttp");
 }else {
  throw new error("ajax is not supported by this www.111cn.net browser");
 }
 xhr.onreadystatechange = function () {
  if (xhr.readystate == 4) {
   if (xhr.status >= 200 && xhr.status < 300) {
    document.getelementbyid('file_list').innerhtml = xhr.responsetext;
   }
  }
 }
 xhr.open('get','anfms.php?action=filelist&path='+path);
 xhr.setrequestheader("if-modified-since","0");
 xhr.send();
}
function file_content_input(data) {
 var data;
 var xhr;
 if (window.xmlhttprequest) {
  xhr = new xmlhttprequest();
 }else if (window.activexobject) {
  xhr = new activexobject("msxml2.xmlhttp");
 }else {
  throw new error("ajax is not supported by this browser");
 }
 xhr.onreadystatechange = function () {
  if (xhr.readystate == 4) {
   if (xhr.status >= 200 && xhr.status < 300) {
    document.getelementbyid('file_content_input').innerhtml = xhr.responsetext;
   }
  }
 }
 xhr.open('get','anfms.php?action=inputcontent&'+data);
 xhr.setrequestheader("if-modified-since","0");
 xhr.send(); 
}
function file_get_content(data) {
 var data;
 var xhr;
 if (window.xmlhttprequest) {
  xhr = new xmlhttprequest();
 }else if (window.activexobject) {
  xhr = new activexobject("msxml2.xmlhttp");
 }else {
  throw new error("ajax is not supported by this browser");
 }
 xhr.onreadystatechange = function () {
  if (xhr.readystate == 4) {
   if (xhr.status >= 200 && xhr.status < 300) {
    document.getelementbyid('file_get_content').innerhtml = xhr.responsetext;
   }
  }
 }
 xhr.open('get','anfms.php?action=getcontent&'+data);
 xhr.setrequestheader("if-modified-since","0");
 xhr.send(); 
}
function file_make(file) {
 var file;
 var xhr;
 if (window.xmlhttprequest) {
  xhr = new xmlhttprequest();
 }else if (window.activexobject) {
  xhr = new activexobject("msxml2.xmlhttp");
 }else {
  throw new error("ajax is not supported by this browser");
 }
 xhr.onreadystatechange = function () {
  if (xhr.readystate == 4) {
   if (xhr.status >= 200 && xhr.status < 300) {
    document.getelementbyid('file_make').innerhtml = xhr.responsetext;
   }
  }
 }
 xhr.open('get','anfms.php?action=filemake&'+file);
 xhr.setrequestheader("if-modified-since","0");
 xhr.send(); 
}
function file_delete(file) {
 var file;
 var xhr;
 if (window.xmlhttprequest) {
  xhr = new xmlhttprequest();
 }else if (window.activexobject) {
  xhr = new activexobject("msxml2.xmlhttp");
 }else {
  throw new error("ajax is not supported by this browser");
 }
 xhr.onreadystatechange = function () {
  if (xhr.readystate == 4) {
   if (xhr.status >= 200 && xhr.status < 300) {
    document.getelementbyid('file_list').innerhtml = xhr.responsetext;
   }
  }
 }
 xhr.open('get','anfms.php?action=delete_file&file='+file);
 xhr.setrequestheader("if-modified-since","0");
 xhr.send(); 
}
function dir_delete(file) {
 var file;
 var xhr;
 if (window.xmlhttprequest) {
  xhr = new xmlhttprequest();
 }else if (window.activexobject) {
  xhr = new activexobject("msxml2.xmlhttp");
 }else {
  throw new error("ajax is not supported by this browser");
 }
 xhr.onreadystatechange = function () {
  if (xhr.readystate == 4) {
   if (xhr.status >= 200 && xhr.status < 300) {
    document.getelementbyid('file_list').innerhtml = xhr.responsetext;
   }
  }
 }
 xhr.open('get','anfms.php?action=delete_dir&file='+file);
 xhr.setrequestheader("if-modified-since","0");
 xhr.send(); 
}
</script>

anfms.php

<?php
/**
 * all needs file e 111cn.net manage system
 * this is a test code
 * return data to ajax
 * by aiens
 * 2010-01-13 19:20
 */

header("content-type: text/html; charset=utf-8");
$document_root = $_server['document_root'];
if ($_get['action'] == 'filelist') { //return file list
 echo '<div class="file_list_t">'; 
 $checkpath = str_replace($document_root,'',$_get['path']);
 if ($checkpath != '/../') {  
  $checkpath = str_replace('../','',$checkpath);
  $path1 = $document_root.str_replace($document_root,'',$_get['path']);
  $dir = opendir($path1);  
  while ($file = readdir($dir)) {
     if (!($file == '..')) {   
     if ($file == '.') {
      $path = $path1.'../';     
      $file = '返回';  
      if ($checkpath != '/') {
       echo '<li><a href="javascript:void(0);" onclick="javascript:file_list(''.$path.'');">'.$file.'</a></li>';
      }
     }else{     
      $path = $path1.$file.'/';     
      $path = iconv('gb2312','utf-8',$path);
      if (is_dir($path1.$file)) {
         echo '<li><a href="javascript:void(0);" onclick="javascript:file_list(''.$path.'');">'.$file.'</a><span><a href="javascript:void(0);" onclick="javascript:if(confirm('确认删除?')) dir_delete(''.$path.'');">删除</a></span></li>';
      }else{
      $file = iconv('gb2312','utf-8',$file);
      $filesize = filesize($path1.$file)/1000;
      echo '<li>'.$file.' - ('.$filesize.'kb)<span><a href="javascript:void(0);" onclick="javascript:if(confirm('确认删除?')) file_delete(''.$path1.$file.'');">删除</a></span></li>';
      }
     }
     }    
  }
  closedir($dir);
 }
 echo '</div>';
}else if ($_get['action'] == 'inputcontent') { //input data to file
 $name = $_get['input_name'];
 $content = $_get['input_content'];
 $data = date('y-m-d h:i:s');
 $fp = @fopen(dirname(__file__).'/'.$name, 'ab');
 $data = "data:".$data."t content:".$content."n";
 $fw = @fwrite($fp, $data, strlen($data));
 @fclose($fp);
 if ($fw) {
  echo '成功写入';
 }else{
  echo '写入失败';
 }
}else if ($_get['action'] == 'getcontent') { //get data to file
 $name = $_get['input_name'];
 $fp = @fopen(dirname(__file__).'/'.$name, 'rb');
 if (!$fp) {
  echo 'www.111cn.net 系统所在目录不存在此文件,无法读取';
  exit;
 }
 while (!feof($fp)) {
  $content = fgets($fp);
  echo $content.'<br />';
 }
}else if ($_get['action'] == 'filemake') { //make dir
 $name = $_get['input_name'];
 function makedir($path) { 
      if (!file_exists($path)) {
        makedir(dirname($path)); 
        return mkdir($path, 0777);   
      } 
    }
 if (makedir($name)) {
  echo '成功创建';
 }else{
  echo '创建失败';
 }
}else if ($_get['action'] == 'delete_file') { //delete file
    $file = $_get['file'];
 unlink($file);
 echo '成功删除';
}else if ($_get['action'] == 'delete_dir') { //delete dir
 $dir = $_get['file'];
 function delete_dir($dir) {
   if(! is_dir($dir)) {
    return false;
   }
    $handle = @opendir($dir);
    while(($file = @readdir($handle)) !== false) {
     if($file != '.' && $file != '..') {
      $dir = $dir . '/' . $file;
      is_dir($dir) ? delete_dir($dir) : @unlink($dir);
     }
    }
   closedir($handle);
   return rmdir($dir) ;
 }
 if (delete_dir($dir)) {
  echo '成功删除';
 }else{
  echo '删除失败';
 } 
}
?>

其实此系统非常的简单的只要把图片上传到服务器,然后再把地址保存在数据库中了,这样下次我们读数据库地址显示即可实现图片管理了。

/*
这是一款简单的php相册系统,包括有如下文件
conn.php数据库教程连接文件以及文件上传功能和分页函数
vc.php 用来显示相册
files.php 照片上传文件
index.php 相册管理代码
savefile.php保存文件代码
*/
?>

index.php

 代码如下 复制代码

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd">
<html xmlns="http://www.111cn.net/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<link href="config/css教程.css" rel="stylesheet" type="text/css" />
</head>

<body>
像册&nbsp;&nbsp;<a href="files.php">增加</a><br />
<hr color="#ff0000" align="left" size="1" width="80%" />
<table border="0" cellspacing="1" cellpadding="1" bgcolor="#cccccc"><tr>
<?php
require_once("config/conn.php");
$sql="select * from images order by imid";
$result=page($sql,16);
$i=1;
while($row=mysql教程_fetch_assoc($result[0]))
{
?>
<td width="120" height="150" align="center" valign="middle" bgcolor="#ffffff">
  <a href="<?="file/".$row["imname"]?>" target="_blank"><img src="<?="file/s_".$row["imname"]?>" alt="<?=$row["imtitle"];?>" border="0"/></a></td>
<?
 if($i%4==0) echo "</tr><tr>";
 $i++;

 }
 ?>
</tr>
</table>
<?php echo $result[1]; ?>


</body>
</html>

 

[!--infotagslink--]

相关文章

  • 不打开网页直接查看网站的源代码

      有一种方法,可以不打开网站而直接查看到这个网站的源代码..   这样可以有效地防止误入恶意网站...   在浏览器地址栏输入:   view-source:http://...2016-09-20
  • php 调用goolge地图代码

    <?php require('path.inc.php'); header('content-Type: text/html; charset=utf-8'); $borough_id = intval($_GET['id']); if(!$borough_id){ echo ' ...2016-11-25
  • JS基于Mootools实现的个性菜单效果代码

    本文实例讲述了JS基于Mootools实现的个性菜单效果代码。分享给大家供大家参考,具体如下:这里演示基于Mootools做的带动画的垂直型菜单,是一个初学者写的,用来学习Mootools的使用有帮助,下载时请注意要将外部引用的mootools...2015-10-23
  • JS+CSS实现分类动态选择及移动功能效果代码

    本文实例讲述了JS+CSS实现分类动态选择及移动功能效果代码。分享给大家供大家参考,具体如下:这是一个类似选项卡功能的选择插件,与普通的TAb区别是加入了动画效果,多用于商品类网站,用作商品分类功能,不过其它网站也可以用,...2015-10-21
  • JS实现自定义简单网页软键盘效果代码

    本文实例讲述了JS实现自定义简单网页软键盘效果。分享给大家供大家参考,具体如下:这是一款自定义的简单点的网页软键盘,没有使用任何控件,仅是为了练习JavaScript编写水平,安全性方面没有过多考虑,有顾虑的可以不用,目的是学...2015-11-08
  • php 取除连续空格与换行代码

    php 取除连续空格与换行代码,这些我们都用到str_replace与正则函数 第一种: $content=str_replace("n","",$content); echo $content; 第二种: $content=preg_replac...2016-11-25
  • php简单用户登陆程序代码

    php简单用户登陆程序代码 这些教程很对初学者来讲是很有用的哦,这款就下面这一点点代码了哦。 <center> <p>&nbsp;</p> <p>&nbsp;</p> <form name="form1...2016-11-25
  • PHP实现清除wordpress里恶意代码

    公司一些wordpress网站由于下载的插件存在恶意代码,导致整个服务器所有网站PHP文件都存在恶意代码,就写了个简单的脚本清除。恶意代码示例...2015-10-23
  • js识别uc浏览器的代码

    其实挺简单的就是if(navigator.userAgent.indexOf('UCBrowser') > -1) {alert("uc浏览器");}else{//不是uc浏览器执行的操作}如果想测试某个浏览器的特征可以通过如下方法获取JS获取浏览器信息 浏览器代码名称:navigator...2015-11-08
  • JS实现双击屏幕滚动效果代码

    本文实例讲述了JS实现双击屏幕滚动效果代码。分享给大家供大家参考,具体如下:这里演示双击滚屏效果代码的实现方法,不知道有觉得有用处的没,现在网上还有很多还在用这个特效的呢,代码分享给大家吧。运行效果截图如下:在线演...2015-10-30
  • JS日期加减,日期运算代码

    一、日期减去天数等于第二个日期function cc(dd,dadd){//可以加上错误处理var a = new Date(dd)a = a.valueOf()a = a - dadd * 24 * 60 * 60 * 1000a = new Date(a)alert(a.getFullYear() + "年" + (a.getMonth() +...2015-11-08
  • PHP开发微信支付的代码分享

    微信支付,即便交了保证金,你还是处理测试阶段,不能正式发布。必须到你通过程序测试提交订单、发货通知等数据到微信的系统中,才能申请发布。然后,因为在微信中是通过JS方式调用API,必须在微信后台设置支付授权目录,而且要到...2014-05-31
  • PHP常用的小程序代码段

    本文实例讲述了PHP常用的小程序代码段。分享给大家供大家参考,具体如下:1.计算两个时间的相差几天$startdate=strtotime("2009-12-09");$enddate=strtotime("2009-12-05");上面的php时间日期函数strtotime已经把字符串...2015-11-24
  • php怎么用拼音 简单的php中文转拼音的实现代码

    小编分享了一段简单的php中文转拼音的实现代码,代码简单易懂,适合初学php的同学参考学习。 代码如下 复制代码 <?phpfunction Pinyin($_String...2017-07-06
  • php导出csv格式数据并将数字转换成文本的思路以及代码分享

    php导出csv格式数据实现:先定义一个字符串 存储内容,例如 $exportdata = '规则111,规则222,审222,规222,服2222,规则1,规则2,规则3,匹配字符,设置时间,有效期'."/n";然后对需要保存csv的数组进行foreach循环,例如复制代...2014-06-07
  • ecshop商品无限级分类代码

    ecshop商品无限级分类代码 function cat_options($spec_cat_id, $arr) { static $cat_options = array(); if (isset($cat_options[$spec_cat_id]))...2016-11-25
  • 几种延迟加载JS代码的方法加快网页的访问速度

    本文介绍了如何延迟javascript代码的加载,加快网页的访问速度。 当一个网站有很多js代码要加载,js代码放置的位置在一定程度上将会影像网页的加载速度,为了让我们的网页加载速度更快,本文总结了一下几个注意点...2013-10-13
  • vue项目,代码提交至码云,iconfont的用法说明

    这篇文章主要介绍了vue项目,代码提交至码云,iconfont的用法说明,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧...2020-07-30
  • IDEA插件之快速删除Java代码中的注释

    这篇文章主要介绍了IDEA插件之快速删除Java代码中的注释,本文给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下...2021-02-18
  • C#超实用代码段合集

    这篇文章主要介绍了C#超实用代码段合集,涉及C#针对图标、数学运算、拼音、日期、时间及文件夹等的相关操作技巧,需要的朋友可以参考下...2020-06-25