if-elif-else事例 score = 85 if score>=90: print 'excellent' elif score<90 and score>=80: print 'good' elif score<80 and score>=60: prin...
原始: L = print L 增加: L.append('ios') print L # 增加: L.insert(2,'android') print L # 删除 L.pop() print L # 替换 L = 'cocod2x'; print L #
ios描述文件生成配置安装 程序积累
ios描述文件生成配置安装 下载链接1 百度云盘 点击下载 下载链接2 网址 点击下载
php5.4以上版本. json_encode($data,JSON_UNESCAPED_UNICODE)
php获得字符串内字符的个数(包含中文) 程序积累
function getstrlen($str,$charset="utf-8") { $re = "/||{2}|{3}/"; $re = "/|/"; $re = "/|/"; $re = "/|\x...
function msubstr($str, $start=0, $length, $charset="utf-8", $suffix=true) { if(function_exists("mb_substr")) $slice = mb_substr($str, $sta...
前几天给pc端写接口用到数据加密,现在总结下,当时主要做的是对pc端传来的数据进行解密,现在用php模拟下加密以及解密 1.加密 第一步:先进行异或加密,然后在base64加密 function my_jiami($str){ //随机取8位数 for($i=0;$i<8;$i++){ ...
$startweek = "本周开始时间:".date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-date("w")+1-7,date("Y"))); $endweek = "本周结束时间:".date("Y-m-d H:i:s",mktime(23,59,59,...
php常用的字符串处理函数 程序积累
1、 查找字符位置函数 strpos($str,search,):查找search在$str中的第一次位置从int开始; stripos($str,search,):函数返回字符串在另一个字符串中第一次出现的位置。该函数对大小写不敏感 strrpos($str,search,):查找search在$str中的最后一次出...
php数组关于键名和键值的常用函数 程序积累
$array=array("Linux","Apache","MySQL","PHP"); print_r(array_keys($array)); //返回所有键名 //Array ( => 0 => 1 => 2...