![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
心火灬
这个作者很懒,什么都没留下…
展开
-
当你发现你的php项目无法正确使用时,使用伪静态把
location /wap/ { try_files $uri /wap/index.html;}location / { if (!-e $request_filename){ rewrite ^(.*)$ /index.php?s=$1 last; break; }}原创 2021-03-30 10:17:54 · 153 阅读 · 0 评论 -
路由定义
Route::rule("/admin/login/verify","/admin/login/verify");Route::rule("/","/index.php/cms");Route::get('think', function () { return 'hello,ThinkPHP5!';});Route::get('hello/:name', 'index/hello');return [];原创 2021-03-29 12:11:09 · 123 阅读 · 0 评论 -
php获取根目录
$_SERVER[‘DOCUMENT_ROOT’]原创 2021-03-23 09:41:11 · 195 阅读 · 0 评论 -
php提示Array to string conversion 解决方案
例如:$branch = Branchmanage::column('id,name');如果直接输出 会是Array( [1] => 细杉厂 [2] => 三旺厂 [3] => 铁炉厂 [4] => 犀牛厂)但是如果我们插入个默认的 这样函数处理就能完成了。 array_unshift($branch, '默认分厂');Array( [0] => 默认分厂 [1] => 细杉厂原创 2021-03-20 16:46:45 · 578 阅读 · 0 评论 -
打印页面时隐藏HTML div
添加print.css到你的页面中,您可以隐藏所有你不想要的元素要打印<link rel="stylesheet" href="print.css" type="text/css" media="print" /> 媒体=“打印”属性告诉浏览器使用特定的CSS文件。在该文件中,你可以有.admindetails{ display:none; } 您可以使用该分区的CSS设置为display: none如下:@media print { div.do-not-原创 2021-03-19 16:14:16 · 808 阅读 · 0 评论 -
记一次mysql恢复
mysqlfrm --diagnostic C:/phpEnv/server/mysql/mysql-5.7/data/sn原创 2021-03-19 14:41:50 · 82 阅读 · 0 评论 -
用PHPExcel 实现服务器端导出
用PHPExcel 导出 excel bootstrap table export 导出格式 自定义导出 多数据导出 导出问题实现前端①. 在模板页的toolbar加入一个导出按钮 <div id="toolbar" class="toolbar"> <a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" >&原创 2021-03-19 09:32:05 · 196 阅读 · 0 评论 -
PHPExcel导出的问题,在PHP7中以及php://input与php://output(转载)
一。错误提示:Fatal error: ‘break’ not in the ‘loop’ or ‘switch’ context in Function.php on line 463.这里写图片描述解决方法:找到phpexcel\PHPExcel\Calculation\Functions.php中的463行,去掉break;就可以了二。http://blog.csdn.net/qq_27682041/article/details/73326435保存表格的时候—不写入到服务器 而是直转载 2021-03-19 09:24:52 · 298 阅读 · 0 评论 -
php://input、php://output用法解析
一、php://output输出流用法:php://output是php语言中一个只写的数据流,向“php://input”写入的数据将像 print() 和 echo() 一样的方式 写入到输出缓冲区;“php://output”支持CLI(command-line interface,命令行界面)模式和Http模式;1 、CLI模式通过php://output向终端输出内容:test.php文件:<?php$output = fopen("php://output", "w");fwr原创 2021-03-19 09:20:53 · 3094 阅读 · 0 评论 -
读取数据库数据并输成excel
数据库php写法:<?phprequire dirname(__FILE__)."./dbconfig.php";//引入配置文件 class db{ public $conn=null; public function __construct($config) { $this->conn = mysql_connect($config['host'], $config['username'], $config['pass原创 2021-03-19 09:06:54 · 111 阅读 · 0 评论 -
phpExcel列数据自动换行的方法
phpexcel是一个强大PHP的功能类,可以用php导入和导出excel文件,在我们做导出数据的时候,当一个单元格中的数据太多的时候会发现内容不会自动换行,是在一整行显示的,看起来很不舒服,是否可以使内容自动换行呢?且看如下实现:$this->excel = PHPExcel_IOFactory::load($inputFileName);$this->sheet = $this->excel->getSheet();$this->sheet->getStyle(原创 2021-03-19 08:54:19 · 2946 阅读 · 0 评论