1.验证码刷新
<img src=http://localhost/QQQQ/index.php/Home/User/index
onClick="this.src=this.src+'?'+Math.random()"/>;
2.图片上传:
$Upload = new Upload();
$res = $Upload->uploadOne($_FILES['book_fengmian']);
$bianji['book_fengmian'] = 'Uploads/'.$res['savepath' ].$res['savename'];
然后在前台显示时; <img src="http://localhost/test/{$vo.book_fengmian}" >
3.表格中获取这一行的数据:<a href="{:U('Bianjitushu/index',array('isbn'=>$vo['isbn'],'name'=>$vo['book_name'],'id'=>$vo[book_id]))}">编辑
4.验证码验证:
$code=$_POST['zhuce'];
var_dump(check_verify($code));
同时,应用配置文件中即Common下新建一个function。php 把配置写进去
function check_verify($code, $id = ''){
$verify = new \Think\Verify();
return $verify->check($code, $id);
}
5.字符串去掉首尾空格
$str= trim($str);// 去掉头尾空格
6.时间转换函数
strtotime() 转换成时间戳
转载于:https://my.oschina.net/gyuan/blog/676228