摘要: PHP中的常用数组操作方法 一、数组操作的基本函数 数组的键名和值 array_values($arr); 获得数组的值 array_keys($arr); 获得数组的键名 array_flip($arr); 数组中的值与键名互换(如果有重复前面的会被后面的覆盖) in_array("apple", 阅读全文
posted @ 2017-12-30 17:48 半只毛毛虫 阅读(4068) 评论(0) 推荐(0) 编辑
摘要: 1,最近在项目里面使用了RSA加密解密的功能 出现的异常情况是加解密时对于有中文的情况会出现乱码,导致无法正常解析参数 解决方案人认为:针对中文应该 先encode ,这样能有效的避免乱码 阅读全文
posted @ 2017-12-30 17:45 半只毛毛虫 阅读(273) 评论(0) 推荐(0) 编辑
摘要: date("Y-m-d H:i",$unixtime) 1.php中获得今天零点的时间戳 要获得零点的unix时间戳,可以使用 $todaytime=strtotime(“today”), 然后再使用 date("Y-m-d H:i",$todaytime)转换为日期。 2 .时间戳转换为日期 时间 阅读全文
posted @ 2017-12-30 17:43 半只毛毛虫 阅读(1101) 评论(0) 推荐(0) 编辑
摘要: count_sentences [计算句数],示例:{$smarty.get.name|count_sentences} count_words [计算词数],示例:{$smarty.get.name|count_words} date_format [时间格式],示例:{$smarty.serve 阅读全文
posted @ 2017-12-30 17:38 半只毛毛虫 阅读(173) 评论(0) 推荐(0) 编辑
摘要: gd_info 函数:获取当前安装的GD库的信息 getimagesize 函数:获取图像的大小 image_type_to_extension 函数:获取图像类型的文件后缀 image_type_to_mime_type 函数:判断一个IMAGETYPE常量的MIME类型 image2wbmp 函 阅读全文
posted @ 2017-12-30 17:33 半只毛毛虫 阅读(374) 评论(0) 推荐(0) 编辑