php日历
摘要:一、计算数据1、new一个Calendar类2、初始化两个下拉框中的数据,年份与月份3、初始化要搜索的年份和月份4、计算得出日历中每一天的数据信息,包括css、天数threshold($year, $month);//获取各个边界值 $caculate = $util->caculate($c...
阅读全文
简单代码实现 加载更多效果
摘要:JS PHP,采用tp框架/* AJAX加载更多 */ public function ajax_more() {//实例化模型 $doctor_evalue_reply = M('doctor_evalue_reply');//获取ajax传值...
阅读全文
用户的权限列表编辑
摘要:/* * 用户的权限列表编辑 * * */ function setaccess() { $id=$_GET['id']; $D=M("Access"); $rdata=$D->where("role_id=".$id)->getField("node_id",true); $M=...
阅读全文
php基础知识
摘要:一、排序 1、sort -- 从最低到最高排序,删除原有的键名,赋予新的键名【字母比数字高】 2、rsort -- 逆向排序(最高到最低),删除原有的键名,赋予新的键名【字母比数字高】 3、asort -- 正向排序,保持索引关系 4、arsort --逆向排序,保持索引关系 5、ksort...
阅读全文
php代码
摘要:select(); foreach($data as &$value) { if($value['last_login_time']!=0) { $value['last_login_time']=date('Y-m-d H:i:s',$value['last_login_tim...
阅读全文
PHP 登录
摘要:display(); } function verify() { $verify=new Verify(); $verify->entry(); } function dologin() { $map=array(); $verify=new Verify(); if(!($verify-...
阅读全文
函数
摘要:array_walk_recursive() 例子 'apple', 'b' => 'banana');$fruits = array('sweet' => $sweet, 'sour' => 'lemon');function test_print($item, $key){echo "$key...
阅读全文
TP代码
摘要:display("essay"); } function add_essay() { date_default_timezone_set('Asia/Shanghai'); $M=M("essay"); $data=$_POST; $data['publishtime']=date('y-m-...
阅读全文
TP代码
摘要:display(); } function into_add() { date_default_timezone_set('Asia/Shanghai'); $M=M("user"); $data=$_POST; $data['in_date']=date('y-m-d H:i:s',time...
阅读全文
php:上传多个文件
摘要:path=$path; $this->files=$files; $this->seterror=1; $this->allowtype=array("jpg","gif","JPG","png","jpeg"); $this->filetype=array(); $this->filen...
阅读全文
上传
摘要:filename=$files['name']; $types=explode(".",$this->filename); $this->filestype=$types[count($types)-1]; $this->filessize=$files['size']; $this...
阅读全文
PHP面向对象(分页)
摘要:table=$table; $this->pagesize=$pagesize; $sql="select * from ".$this->table.""; $query=mysql_query($sql); $num=mysql_num_rows($query); $this...
阅读全文
Array函数
摘要:array_flip()例子 1, "b" => 1, "c" => 2);$trans = array_flip($trans);print_r($trans);?> 答案:Array( [1] => b [2] => c)array_values() 例子 "XL", "color"...
阅读全文
Array数组
摘要:array_diff_key() 例子 1, 'red'=> 2, 'green'=> 3, 'purple' => 4);$array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan'=> 8);var_dump(array_dif...
阅读全文
Smarty 分页
摘要:1 2 First //第一页3 {if $pagerInfo.currentPage > 1} //如果当前页大于1,则有pre链接4 Pre5 {else}6 Pre7 {/if}8 index+1} //index从0开始计数10 {$pindex}11 {/section}12 {i...
阅读全文