随笔分类 -  php

php相关笔记
摘要:$directory_arr = scandir($path); unset($directory_arr[0]);//删除 . unset($directory_arr[1]);//删除 .. $directory_arr = array_values($directory_arr);//重置in 阅读全文
posted @ 2022-03-17 13:08 树之下 阅读(73) 评论(0) 推荐(0)
摘要:前言 php7.4后不支持 array{} 这种形式数组取值 参考官方文档:7.4 版本的向后不兼容更改,非数组的数组样式访问,现在,尝试将 null,bool,int,float 或 resource 类型的值用作数组 ( 例如 $null[“key”] ) 会产生一个通知。 修改后的PHPExc 阅读全文
posted @ 2022-03-02 14:41 树之下 阅读(1615) 评论(1) 推荐(0)
摘要:php artisan make:controller FileController php artisan make:model Report composer require phpoffice/phpexcel composer remove phpoffice/phpexcel 阅读全文
posted @ 2022-01-26 09:23 树之下 阅读(37) 评论(0) 推荐(0)
摘要:前言 随便笔记,随便记录 日志输出 日志输出 file_put_contents('D:\log.txt',date('Y-m-d H:i:s')."日志内容写在这里"."\r\n\r\n" , FILE_APPEND | LOCK_EX); 文件引入 //当前文件绝对路径 dirname(__FI 阅读全文
posted @ 2021-12-30 11:14 树之下 阅读(67) 评论(0) 推荐(0)
摘要:有一张xlsx表里记录表名,字段,类型,备注,主键信息。使用php读取表并创建数据库表。 <?php //声明header头部 header("Content-type:text/html;charset=utf-8"); //引入类库 include "../phpExce/Classes/PHP 阅读全文
posted @ 2021-11-16 18:37 树之下 阅读(253) 评论(0) 推荐(0)
摘要:<?php class Student{ public $name; protected $sex; private $add; public function __construct($name,$sex,$add) { $this->name = $name; $this->sex = $sex 阅读全文
posted @ 2021-08-24 14:45 树之下 阅读(41) 评论(0) 推荐(0)
摘要:<?php namespace China\Beijing\shunyi; function getInfo(){ echo '顺义...<br>'; } namespace China\Beijing; function getInfo(){ echo '北京...<br>'; } getInfo 阅读全文
posted @ 2021-08-24 10:48 树之下 阅读(26) 评论(0) 推荐(0)
摘要:php实现简单增删改查:test.php是主页,insert.php是添加页,del.php是删除页。 sql代码 DROP TABLE IF EXISTS `bnk_test2`; CREATE TABLE `bnk_test2` ( `id` int NOT NULL AUTO_INCREMEN 阅读全文
posted @ 2021-08-18 16:59 树之下 阅读(2306) 评论(0) 推荐(0)