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

浙公网安备 33010602011771号