• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
百里屠苏phper
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理
上一页 1 2 3 4 5 6 7 ··· 10 下一页

2023年1月10日

进制互相转换
摘要: $mtime = base_convert(1*60, 10, 16); //把10进制转化为16进制 $mtime = str_pad($mtime, 8, "0", STR_PAD_LEFT); //填充字符到固定长度,例如字符串长度不够就填充0,直至够8个字符长度 阅读全文
posted @ 2023-01-10 11:58 百里屠苏phper 阅读(36) 评论(0) 推荐(0)
 
 

2023年1月6日

MYSQL 批量插入一万条数据
摘要: $sql = sprintf("INSERT INTO iot_client_number2 (owid,server,jh,ebiao,xq) VALUES "); foreach($save as $item) { $itemStr = '( '; $itemStr .= sprintf("%d 阅读全文
posted @ 2023-01-06 12:00 百里屠苏phper 阅读(776) 评论(0) 推荐(0)
 
curl 异步请求
摘要: public function test() { $body = file_get_contents('php://input'); $header = array( 'application/json; charset=utf-8' ); $url = 'https://www.aiotagro. 阅读全文
posted @ 2023-01-06 11:53 百里屠苏phper 阅读(445) 评论(0) 推荐(0)
 
 

2022年9月22日

MySQL分组查询,将其它列的数据,合并到一行展示
摘要: SELECT author_id, author_name, substring_index( group_concat( DISTINCT task_id ORDER BY task_id ASC ), ',', 3 ) AS taskList FROM author_info GROUP BY 阅读全文
posted @ 2022-09-22 10:34 百里屠苏phper 阅读(210) 评论(0) 推荐(0)
 
 

2022年5月13日

php模拟发送post请求
摘要: 第一种方法: function send_post($url, $post_data) { $options = array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type:application/x-www-form- 阅读全文
posted @ 2022-05-13 16:42 百里屠苏phper 阅读(1165) 评论(0) 推荐(0)
 
 

2022年3月24日

MySQL 批量插入或更新数万条数据
摘要: 更新代码示例: $sql = replace into dbname (sn,字段1,字段2,字段3,字段4,字段5) values (15010000001,1,2,3,4,5) 添加代码示例: $sql = sprintf("INSERT INTO dbname (sn,字段1,字段2,字段3, 阅读全文
posted @ 2022-03-24 12:55 百里屠苏phper 阅读(1120) 评论(0) 推荐(0)
 
 

2022年1月26日

生成唯一订单号纯数字
摘要: $order_id_main = date('md') . rand(100000, 999999); $order_id_len = strlen($order_id_main); $order_id_sum = 0; for ($i = 0; $i < $order_id_len; $i++) 阅读全文
posted @ 2022-01-26 15:36 百里屠苏phper 阅读(181) 评论(0) 推荐(0)
 
 

2021年7月28日

PHP移动端用户登录 生成随机唯一 appToken
摘要: /** * 生成随机唯一 appToken * @return string */ public function getAppToken() { //strtoupper转换成全大写的 $charid = strtoupper(md5(uniqid(mt_rand(), true))); retu 阅读全文
posted @ 2021-07-28 14:37 百里屠苏phper 阅读(234) 评论(0) 推荐(0)
 
PHP 生成永远唯一的密钥码、激活码自定义方法函数
摘要: /** * 生成永远唯一的密钥码 * sha512(返回128位) sha384(返回96位) sha256(返回64位) md5(返回32位) * 还有很多Hash函数...... * @author xiaochaun * @param int $type 返回格式:0大小写混合 1全大写 2全 阅读全文
posted @ 2021-07-28 14:31 百里屠苏phper 阅读(249) 评论(0) 推荐(0)
 
 

2021年7月12日

微信小程序 map组件 include-points 缩放视野以包含所有给定的坐标点
摘要: 代码如下: <template> <view> <view class="page-body"> <view class="page-section page-section-gap"> <map style="width: 99%; height: 99vh;" show-compass :lat 阅读全文
posted @ 2021-07-12 01:23 百里屠苏phper 阅读(2300) 评论(0) 推荐(0)
 
 
上一页 1 2 3 4 5 6 7 ··· 10 下一页

公告


博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3