php创建目录

php创建目录

//创建目录function makedir($base_path = '') {//判断路径是否存在 if (!is_dir ( $base_path )) { mkdir ( $base_path, 0777, TRUE ); }}

PHP 2019-12-11 PM 1566次 0条
php获取两个日期之间的所有日期

php获取两个日期之间的所有日期

/**获取两个日期之见的所有日期*/function prDates($start,$end){ $dt_start = $start; $dt_end = $end; while ($dt_start<=$dt_end){ $pr_dates[] = date('Y-m-d',$dt_start)."\n"; $dt_start = strtotime...

PHP 2019-12-11 PM 2605次 0条
php创建指定长度的字符串

php创建指定长度的字符串

/**@param $codeLen 随机字符串长度@return string 随机字符串 */function randStr($codeLen){$str="abcdefghijkmnpqrstuvwxyz0123456789"; $rand=""; for($i=0; $i<$codeLen-1; $i++){ $rand .=...

PHP 2019-12-11 PM 1627次 0条
php 判断日期是当天

php 判断日期是当天

/**判断日期是当天@param $time@return bool */function time_judge($time){// 截取日期部分,摒弃时分秒$result = substr($time, 0, 10);// 获取今天的日期,格式为 YYYY-MM-DD$date = date('Y-m-d');// 使用IF当作字符串判断是否相等if ($result == $date) ...

PHP 2019-12-11 PM 2212次 0条
php正则检测手机号码格式

php正则检测手机号码格式

/**正则检测手机号码格式**/public function checkMobileFormat($sMobile){$sPregMatch = '/^1(3[0-9]|4[57]|5[0-35-9]|7[0-9]|8[0-9])\d{8}$/';return preg_match($sPregMatch, $sMobile);}

PHP 2019-12-11 PM 2603次 0条
php根据用户uuid获取token

php根据用户uuid获取token

/** * 根据用户uuid获取token * @param [type] $uuid [description] * @return [type] [description] */ public function getToken($uuid) { $v = $uuid; $key = mt_rand(); $hash = hash_hmac(&...

PHP 2019-12-11 PM 2845次 0条
php curl模拟get/post提交

php curl模拟get/post提交

/** * curl模拟get/post提交 * @param $url 请求的url地址 * @param $data 发送的数据 * @param $type 请求的类型 * @return $result 返回的数据 */ function httpsRequest(String $url, $data = [], $type = "html"){ ...

PHP 2019-12-11 PM 1699次 0条
php中文转阿拉伯

php中文转阿拉伯

/**中文转阿拉伯@param $str@return float|int|mixed */function chrtonum($str){$num = 0; $bins = array("零", "一", "二", "三", "四", "五", "六"...

PHP 2019-12-11 PM 1651次 0条
php curl模拟get请求

php curl模拟get请求

/*** @param string $url 地址 */function get_url($url){ $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,$url); //设置访问的url地址 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_set...

PHP 2019-12-11 PM 1705次 0条
php随机IP

php随机IP

/**随机IP方法@param@return string $huoduan_ip 最终IP地址 */function rand_ip(){$ip_long = array( array('607649792', '608174079'), //36.56.0.0-36.63.255.255 array('975044608', '977272831'), /...

PHP 2019-12-11 PM 2627次 0条
php手机号

php手机号

//随机手机号function randphone(){$arr = array(130,131,132,133,134,135,136,137,138,139, 144,147, 150,151,152,153,155,156,157,158,159, 176,177,178, 180,181,182,183,184,185,...

PHP 2019-12-11 PM 1724次 0条