php - PHP博客_【PHP爱好者】共同学习分享PHP技术心得-田螺的个人博客 php - PHP博客_【PHP爱好者】共同学习分享PHP技术心得-田螺的个人博客

包含标签 php 的所有文章

PHP

PHP 生成随机用户名

田螺 发布于 8-15

//生成随机用户名functionget_username(){$chars1="ABCDEFGHIJKLMNOPQRSTUVWXYZ";$chars2="abcdefghijklmnopqrstuvwxyz0123456789";$username="";for($i=0;$i<mt_rand(2,3);$i++){$username.=...

阅读(102) 评论(0)

PHP

PHP 修改本地配置文件

田螺 发布于 8-15

/***修改本地配置文件**@paramarray$name['配置名']*@paramarray$value['参数']*@returnvoid*/functionsetconfig($name,$value){if(is_array($name)andis_array($value)){for($i=0;$i<count($name);...

阅读(60) 评论(0)

PHP

PHP判断当前时间是否在指定时间段之内

田螺 发布于 8-15

/***判断当前时间是否在指定时间段之内*@paraminteger$a起始时间*@paraminteger$b结束时间*@returnboolean*/functioncheck_time($a,$b){$nowtime=time();$start=strtotime($a.':00:00');$end=strtotime($b.':00:00...

阅读(63) 评论(0)

PHP

PHP缓存写入和读取缓存文件

田螺 发布于 4-18

调用: $cacheData=serialize(数据);//序列化    $this->cacheWrite($cacheData,'缓存名称');/***写入缓存*/functioncacheWrite($cacheData,$cacheName){$cachefile=EMLOG_RO...

阅读(63) 评论(0)

PHP

CURL工具封装curl类

田螺 发布于 4-18

<?php/****CURL工具**ClassCurl*/if(!defined('IN_T')){die('hackingattempt');}classCurl{privatestatic$_ch;privatestatic$_header;privatestatic$_body;privatestatic$_cookie=array(...

阅读(58) 评论(0)

PHP

PHP中把stdClass Object转array的几个方法

田螺 发布于 3-27

我们在经常使用API接口获取数据返回json数值的时候,往往单纯通过json_decode方法解析获得得数值一般并非数组,而是带有stdClassObjec的对象字符串,这时如果我们想获取相应的PHP数组时,需通过以下几种方法来获取。方法一://PHP stdClass Object转array  func...

阅读(98) 评论(0)