PHPUnit PHP测试框架安装方法

yipeiwu_com6年前
单元测试是几个现代敏捷开发方法的基础,使得PHPUnit成为许多大型PHP项目的关键工具。这个工具也可以被Xdebug扩展用来生成代码覆盖率报告 ,并且可以与phing集成来自动测试,最...

php去掉字符串的最后一个字符附substr()的用法

yipeiwu_com6年前
php去掉字符串的最后一个字符附substr()的用法
今天项目中用到,去掉字符串中的最后一个字符 原字符串1,2,3,4,5,6, 去掉最后一个字符",",最终结果为1,2,3,4,5,6 代码如下: 复制代码 代码如下: $str = "...

php expects parameter 1 to be resource, array given 错误

yipeiwu_com6年前
如果你使用的是封装好的类 例如 function fetch_array($query, $result_type = MYSQL_ASSOC) { return mysql_fetch...

php函数之子字符串替换 str_replace

yipeiwu_com6年前
str_replace — 子字符串替换 [str_replace]mixed str_replace ( mixed $search , mixed...

PHP 事件机制(2)

yipeiwu_com6年前
复制代码 代码如下: <?php class Event extends stdClass{ public $target=null; public $type=null; /**...

PHP+JS+rsa数据加密传输实现代码

yipeiwu_com6年前
JS端代码: 复制代码 代码如下: //文件base64.js: var b64map="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuv...

php中取得URL的根域名的代码

yipeiwu_com6年前
复制代码 代码如下: <?php /** * 取得根域名 * * @author lonely * @create 2011-3-11 * @version 0.1 * @last...

PHP中用接口、抽象类、普通基类实现“面向接口编程”与“耦合方法”简述

yipeiwu_com6年前
复制代码 代码如下: <?php /* 边学边做的,为方便自己翻阅而发布,更为得到高人指点而发布,欢迎高手指点...... 【提示】本例通过测试无误 【情景设计】 模拟计算机主板I...

PHP面向接口编程 耦合设计模式 简单范例

yipeiwu_com6年前
复制代码 代码如下: <?php interface js{ function ys($a,$b); } class Af implements js{ function ys($...

常见的PHP五种设计模式小结

yipeiwu_com6年前
常见的PHP五种设计模式小结
设计模式 一书将设计模式引入软件社区,该书的作者是 Erich Gamma、Richard Helm、Ralph Johnson 和 John Vlissides Design(俗称 “...