随笔分类 -  php

摘要:无聊的时候也可以写着玩 function substrtext($text, $length) { if(mb_strlen($text, 'utf8') $length) return mb_substr($text, 0, $length, 'utf8').'...'; return $text 阅读全文
posted @ 2018-01-16 16:41 小酱油 阅读(313) 评论(0) 推荐(0) 编辑
摘要://导入方法 public function importdata(){ $file = './a.excel'; if (!file_exists($file)) { $re['msg'] = '模板文件出错,请重新上次模板文件'; } / Include PHPExcel / require_o 阅读全文
posted @ 2018-01-16 16:37 小酱油 阅读(174) 评论(0) 推荐(0) 编辑
摘要:var lists = <?php echo $scannerlist;? ; var js_getCityUrl = "{:U(MODULE_NAME.'/ScannerManager/getCity','','',true)}"; var js_getMapUrl = "{:U(MODULE_N 阅读全文
posted @ 2018-01-16 16:35 小酱油 阅读(157) 评论(0) 推荐(0) 编辑
摘要:例子: array( "id"= "1208", "fromid"= "2", "froms"= "strategy", "name"= "", "sort"= "1" ), 1= array( "id"= "1209", "fromid"= "3", "froms"= "strategy", "n 阅读全文
posted @ 2018-01-16 16:33 小酱油 阅读(304) 评论(0) 推荐(0) 编辑
摘要:顺序安装:linux apache mysql php Linux 这个就不多说明了... CentOS 6.5 镜像 虚拟机安装 一次性安装开发工具: yum groupinstall "Development tools" or: yum y groupinstall "Development 阅读全文
posted @ 2018-01-16 16:32 小酱油 阅读(121) 评论(0) 推荐(0) 编辑
摘要://时间的计算与转换 一: echo date('Y m d',strtotime(' 5 day')); 二:两种想写法,效果一样。 echo date('Y m d H:i:s',strtotime("+8 hour",strtotime('2016 10 14 10:15:00') )); e 阅读全文
posted @ 2018-01-16 16:17 小酱油 阅读(134) 评论(0) 推荐(0) 编辑
摘要:栗子:判断字符中是否存在大小写和数字; 阅读全文
posted @ 2018-01-16 16:16 小酱油 阅读(661) 评论(0) 推荐(0) 编辑
摘要:一、Model+数据库的切换使用 //也许用到了命名空间,举个例子 namespace Model\User; use \Think\Model; class User extends Model{ //继承tp的基类 } 方法一:使用ThinkPHP的初始化方法_initialize(); pub 阅读全文
posted @ 2018-01-16 16:15 小酱油 阅读(418) 评论(0) 推荐(0) 编辑
摘要:代码: function downloadFile(){ //文件路径(路径+文件名) $file_name = U('/temp/downloadfile.xlsx','',false,true); // required header('Pragma: public'); //no cache 阅读全文
posted @ 2018-01-16 16:12 小酱油 阅读(1729) 评论(0) 推荐(0) 编辑
摘要:栗子: load( $uploadfile ); $sheetData = $objPHPExcel getActiveSheet() toArray( null, true, true, true ); $addData = array(); foreach ( $sheetData as $ke 阅读全文
posted @ 2018-01-16 16:09 小酱油 阅读(117) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示