php常用方法

php中字符串大小写转换

ucfirst() 函数把字符串中的首字符转换为大写。$str="hello world";echo ucfirst($str);运行结果为:Hello world ...

php过滤html标签和实体空格

php过滤html标签和实体空格//$str字符串 preg_replace ('/ /is', '', strip_tags($st...

php编码格式转换

php编码格式转换$contentData = '测试'; $encode = mb_detect_encoding($contentData, array...

完整PHP正则表达式

完整PHP正则表达式,php正则一、校验数字的表达式  1 数字: ^[0-9]*$ 2 n位的数字: ^\d{n}$ 3 至少n...

PHP 常用的header头部定义汇总

PHP 常用的header头部定义汇总header() 函数向客户端发送原始的 HTTP 报头。 header('HTTP/1.1 200&...

PHP单例模式优点减少资源浪费

PHP单例模式优点减少资源浪费这个图片就说明了单例模式的优点:写法如下<?php namespace App; class Test {...