![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
蜗蜗奶糖
这个作者很懒,什么都没留下…
展开
-
php 生成随机字符串
public function getRandCode() { $charts = "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghjkmnpqrstuvwxyz0123456789"; $max = strlen($charts); $noncestr = ""; for($i = 0; $i原创 2016-10-15 10:34:47 · 3041 阅读 · 0 评论 -
php 获取发起请求的类型$_SERVER['REQUEST_METHOD']
<?phpif($_SERVER['REQUEST_METHOD']=='POST' && $_POST['trade_no']){ ......}?>转载 2018-12-04 15:50:00 · 7573 阅读 · 0 评论 -
隐藏式加载后自动提交表单
<form style='display:none;' id='form1' name='form1' method='post' action='http://www.sijicn.cn/ThinkPHP/Extend/Vendor/Epay/pay.php'> <input name='money' type='text' value='2.00...原创 2018-12-01 05:45:58 · 736 阅读 · 1 评论 -
php 生成全世界唯一订单号
function order_no(){ return substr(date('Ymd') . substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 8), 4, 16);}用uniqid获取一个基于当前的微秒数生成的唯一不重复的字符串(但是他的前7位貌似很久才会发生变...转载 2018-12-03 13:07:29 · 652 阅读 · 0 评论 -
thinkphp 模板下拉列表根据变量的值设置默认值
<form name='SearchForm' id="form" id='SearchForm' method='POST' action="__ROOT__/admin.php/User/listuser"> <select name="states" class="bu-select"> <option value="转载 2018-12-06 11:06:48 · 564 阅读 · 0 评论 -
php &=get 过来的参数转数组
$str = $_SERVER['QUERY_STRING'];$arr = explode('&', $str);$res = array();foreach ($arr as $k => $v) { $arr = explode('=', $v); $res[$arr[0]] = $arr[1];}print_r($res);转载 2018-12-04 01:51:13 · 2612 阅读 · 0 评论 -
thinkphp查询当天购买特定商品的订单数量
// <!--查询当前用户在当天购买特定商品的订单数量$GoodsOrder = M('goods_order');$t_start=strtotime(date("Y-m-d 00:00:01"));$t_end =strtotime(date("Y-m-d 23:59:59"));$mapGo['add_time'] = array(array('egt',$t_start),...原创 2019-02-09 17:10:37 · 1685 阅读 · 0 评论 -
php 生成随机钱数(带分)
<?phpecho randMoney(10000, 20000);function randMoney($min, $max){ $num = mt_rand($min, $max); $point = randFloat(); $point = floor($point * 100) / 100; $money = $num + $point; ...原创 2019-03-09 16:42:12 · 1372 阅读 · 0 评论