PHP
无解的游戏
这个作者很懒,什么都没留下…
展开
-
Mac m1 安装mnmp 并且成功编译swoole扩展 PHP版本为7.4
Mac m1安装mnmp(Mac,nginx,mysql,php)使用brew来安装php,nginx,mysql# 搜索php的版本brew search php# 下载phpbrew install [email protected]# 加载到 .zshrcexport PATH="/opt/homebrew/opt/[email protected]/bin:$PATH"export PATH="/opt/homebrew/opt/[email protected]/sbin:$PATH"# 使之有效source ~/.zshrc#原创 2021-04-24 19:57:07 · 1018 阅读 · 0 评论 -
leetcode获取最长公共前缀
LeetCode获取最长公共前缀<?php//编写一个函数来查找字符串数组中的最长公共前缀。 //// 如果不存在公共前缀,返回空字符串 ""。 //// //// 示例 1: //// //输入:strs = ["flower","flow","flight"]//输出:"fl"// //// 示例 2: //// //输入:strs = ["dog","racecar","car"]//输出:""//解释:输入不存在公共前缀。 //// ////原创 2021-04-20 11:09:07 · 95 阅读 · 0 评论 -
phpstudy 配置站点域名
phpstudy 配置站点域名使用httpd-vhosts.conf进行配置虚拟域名添加以下代码<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot "项目目录/public" ServerName 网址名 ServerAlias 别名 ...原创 2019-12-11 20:30:08 · 258 阅读 · 0 评论 -
ThinkPHP5.1 清除缓存
ThinkPHP5.1 清除缓存在基类控制器里,写上clear()方法,到时候用于调用,在也不是JS里alert('清除缓存了')public function clear(){ if (delete_dir_file(CACHE_PATH) || delete_dir_file(TEMP_PATH)) { return json(["code"=>1,"ms...原创 2019-12-03 19:39:57 · 2217 阅读 · 0 评论 -
宝塔Linux面板 + PHPStorm配置FTP文件上传
PHPStorm配置FTP1. 在服务器创建FTP在宝塔Linux面板中添加站点的时候会有选择是否添加FTP选项,选择添加,并且会自动生成对应的用户和密码2. 更改项目目录为www用户权限我使用XShell进行连接宝塔Linux面板中,项目主要位置一般在/www/wwwroot/下首先进入存放项目的目录cd /www/wwwroot其次进入对应的项目中cd y...原创 2019-11-21 21:52:10 · 1004 阅读 · 0 评论 -
PHP实现单例模式
定义:单例模式是一种类的设计,只会最多产生一个对象的设计思想首先定义一个空类,叫做Singleton<?phpclass Singleton {}禁止实例化,只禁止在类外部实例化对象,私有化构造方法class Singleton{ // 私有化构造方法 private function __construct() { ec...原创 2019-10-14 19:53:02 · 95 阅读 · 0 评论