php 把全角数字转为半角数字

php 把全角数字转为半角数字

//把全角数字转为半角数字function GetAlabNum($fnum){ $nums = array(“0”,”1”,”2”,”3”,”4”,”5”,”6”,”7”,”8”,”9”); $fnums = “0123456789”; for($i=0;$i<=9;$i++) $fnum = str_replace($nums[$i],$fnums[$i],$fnum); $fnum = ereg_replace(“[^0-9\.]|^0{1,}”,””,$fnum); if($fnum==””) $fnum=0; return $fnum; }

PHP 2020-09-19 PM 2134℃ 0条
php 获取当前的脚本网址

php 获取当前的脚本网址

function get_php_url(){ if(!empty($_SERVER[“REQUEST_URI”])){ $scriptName = $_SERVER[“REQUEST_URI”]; $nowurl = $scriptName; }else{ $scriptName = $_SERVER[“PHP_SELF”]; if(empty($_SERVER[“QUERY_STRING”])) $nowurl = $scriptName; else $nowurl = $scriptName.”?”.$_SERVER[“QUERY_STRING”]; } return $nowur...

PHP 2020-09-19 PM 2116℃ 0条
php隐藏手机号

php隐藏手机号

/** * 隐藏手机号hide mobile like 138****5493 * @param [type] $mobile [description] * @return [type] [description] */ function hideMobile($mobile){ $pattern = "/(1\d{1,2})\d\d(\d{0,3})/"; $replacement = "\$1****\$3"; return preg_replace($pattern, $replace...

PHP 2020-09-19 PM 3080℃ 0条
短信验证码

短信验证码

短信验证码/**短信验证码@param integer $lenght [description]@return [type] [description] */function smsNumber($lenght=6){$char="1234567890"; $str = ""; while(strlen($str) < $lenght){ $str .= substr($char, (mt_rand()%strlen($char)),1); } return $str;}

PHP 2020-09-19 PM 2812℃ 0条
php判断是否是空字符串

php判断是否是空字符串

/** * 判断是否是空字符串 * * @param string $string 字符串 * @return bool */ function isempty($string) { if(!is_string($string)) {return false;} if (empty($string)) {return false;} if($string =="") {return false;} return true; }

PHP 2020-09-19 PM 2298℃ 0条
常用笔记:PHP

常用笔记:PHP

常用笔记:PHP 【PHP】date_default_timezone_set(PRC); //时区设置header("Content-type: text/html; charset=utf-8");error_reporting(E_ALL & ~E_DEPRECATED & ~E_NOTICE & ~E_WARNING);ini_set ('memory_limit', '1280M');【PHP保留两位小数】复制代码<?php$num = 1234.56;echo ceil($num); //1235,进一法echo floor($num); //1234,取整数舍小数e...

PHP 2020-06-02 PM 3531℃ 0条
PHP正则表达式

PHP正则表达式

正则表达式的主要作用是:分割、匹配、查找、替换正则表达式中包括的元素:原子(普通字符:a-z A-Z 0-9 、原子表、转义字符)元字符(有特殊功能的字符)模式修正符(系统内置部分字符 i 、m、S、U...)转义字符\d 包含所有数字[0-9]\D 除所有数字外1\w 包含所有字符(大小写英文字母、下划线、数字) [a-zA-Z_0-9]\W 除所有字符(大小写英文字母、下划线、数字)外 2\s 空白区域如回车、换行、分页等 [\f\n\r]\S 非空白区域如回车、换行、分页等 3元字符. 匹配任意次但不包含回车换行匹配任意次? 匹配0次或1次匹配1次或多次| 选择匹配(或者)^ 匹配...

PHP 2020-06-02 PM 2766℃ 0条
html代码实现八卦图

html代码实现八卦图

<!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>title</title> <style> *{ margin: 0; padding: 0; } #container{ width: 48px; height...

前端 2020-06-01 PM 4231℃ 0条
分词API接口

分词API接口

玻森分词:https://bosonnlp.com/demo搜狗分词:http://www.sogou.com/labs/webservice

API接口 2020-06-01 PM 3410℃ 0条
免费翻译api接口

免费翻译api接口

爱词霸翻译:http://dict-co.iciba.com/search.php?word=hello

API接口 2020-06-01 PM 4838℃ 0条
免费IP查询接口

免费IP查询接口

搜狐本机IP查询1:http://pv.sohu.com/cityjson搜狐本机IP查询2:http://txt.go.sohu.com/ip/soip搜狐本机IP查询(指定编码):http://pv.sohu.com/cityjson?ie=utf-8太平洋电脑网本机IP查询:http://whois.pconline.com.cn/ipJson.jsp?callback=hello太平洋电脑网IP查询:http://whois.pconline.com.cn

API接口 2020-06-01 PM 4719℃ 0条