admin

帅气的我简直无法用语言描述!
PHP设计模式之观察者模式浅析(观察者模式应用实例)没想到

PHP设计模式之观察者模式浅析(观察者模式应用实例)没想到

<?php // 主题接口 interface Subject { public function attach(Observer $observer); public function de...
1年前
3200
PHP设计模式之模板方法模式Template Method Pattern详解(php设计模式六大原则有哪些)全程干货

PHP设计模式之模板方法模式Template Method Pattern详解(php设计模式六大原则有哪些)全程干货

//抽象出来一个下载类 abstract class DownloadSongs { protected $singer; protected $operator; public function ...
1年前
3020
PHP设计模式之中介者模式浅析(中介者模式的定义和特点)深度揭秘

PHP设计模式之中介者模式浅析(中介者模式的定义和特点)深度揭秘

<?php // 抽象中介者 abstract class Mediator { abstract public function send($message, $colleague); } ...
1年前
2860
PHP设计模式中观察者模式详解(观察者模式代码实现)没想到

PHP设计模式中观察者模式详解(观察者模式代码实现)没想到

class OrderListener implements \SplSubject { //观察者列表 public $observers; public function __construct...
1年前
2820
PHP设计模式中的命令模式(php常见的设计模式)不看后悔

PHP设计模式中的命令模式(php常见的设计模式)不看后悔

<?php // 抽象命令类 abstract class Command { protected $receiver; public function __construct(Receive...
1年前
2900
PHP计算字符串真正的宽度和高度像素(图片加文字水印示例)(php字符长度)这都可以?

PHP计算字符串真正的宽度和高度像素(图片加文字水印示例)(php字符长度)这都可以?

<?php //指定图片路径 $img=trim($_POST['img']); //获取图片信息 $info=getimagesize($img); //获取图片扩展名 $type=imag...
1年前
2700
PHP行为设计模式之策略模式(php策略模式和工厂模式的区别和联系)一篇读懂

PHP行为设计模式之策略模式(php策略模式和工厂模式的区别和联系)一篇读懂

<?php interface MathStrategy { public function calculate(int $a, int $b): int; } class Addition ...
1年前
3000
PHP行为型模式之责任链模式(thinkphp5运行原理)太疯狂了

PHP行为型模式之责任链模式(thinkphp5运行原理)太疯狂了

<?php // 抽象处理器类 abstract class Handler { protected $successor; public function setSuccessor(Hand...
1年前
2750
PHP获取特殊时间戳的方法整理(php如何获取时间)居然可以这样

PHP获取特殊时间戳的方法整理(php如何获取时间)居然可以这样

function gettimestamp($targetTime){ switch ($targetTime){ case 'today'://今天 $timeamp['start']=strto...
1年前
2800
php获取文件扩展名的3种方法实例(php取url参数)速看

php获取文件扩展名的3种方法实例(php取url参数)速看

 目录前言PHP pathinfo()获取文件扩展名PHP SplFileInfo获取文件后缀PHP substr()和strrchr()函数获取文件扩展名总结 在php开发过程中,获取文件扩展名是...
1年前
3380