![](https://img-blog.csdnimg.cn/20201014180756757.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
php
lyshensir
沈老师的技术博客
展开
-
VScode 配置php debug
一、先到http://pecl.php.net/package/xdebug下载对应版本的xdebug,我本机用的php study,下载的是2.6的稳定版。 二、配置php.ini 本来没有加 remote_autostart,我滴妈呀,整了好久。一定要加上。 [XDebug] xdebug.remote_enable = 1 xdebug.remote_autostart = 1 xdebug.remote_host= 10.64.130.19 xdebug.remote_port = 90..原创 2021-07-12 18:07:29 · 1126 阅读 · 2 评论 -
php数组妙用,根据id关联来实现合并
<?php /* 需求: 有两个表,一个是groupdefine表,一个是groupinfo表吧 groupdefine的表结构: grpid name time 1 测试1 2019 2 测试2 2018 groupinfo的表结构: grpid empno 1 110 1 111 1 112 1 113 2 120 2 121 通...原创 2019-11-15 16:25:49 · 884 阅读 · 1 评论 -
php curl 代理
PHP进行curl post和get时,通过代理方式: function https_request($url,$data = null) { $arrip=array("192.168.0.10","8080"); $oCurl = curl_init(); curl_setopt($oCurl, CURLOPT_PROXY, $arrip[0]); curl_seto...原创 2019-05-24 10:04:50 · 1245 阅读 · 0 评论 -
php 任意时间区间,计算工作日
<?php function get_weekend_days($start_date, $end_date, $weekend_days=1) { $data = array(); if (strtotime($start_date) > strtotime($end_date)) list($start_date, $end_date) = array($en...原创 2019-05-30 14:59:44 · 1705 阅读 · 0 评论 -
php命名空间
<?php namespace web\demo\a; class test1{ function __construct(){ echo 'test_a<br>'; } } namespace web\demo\b; class test1{ function __construct(){ echo 'test_b...原创 2019-01-16 21:56:54 · 120 阅读 · 0 评论 -
Thinkphp邮件发送
/** * 系统邮件发送函数 * @param string $to 接收邮件者邮箱 * @param string $name 接收邮件者名称 * @param string $subject 邮件主题 * @param string $body 邮件内容 * @param string $attachment 附件列表 * @return boolean */ functi...原创 2018-12-24 16:47:32 · 178 阅读 · 0 评论 -
jsonp的原理,与php结合的原生介绍
今天在处理json格式的数据,也用到了jsonp的数据处理,特备注一下,免的遗忘。 jsonp格式主要是为了解决跨域请求的问题,我们先以原生实例来说明: 前台:http://10.61.129.100/test.php 后台:http://10.64.128.21/test/jsonp.php 1、首先在前台 http://10.61.129.100/test.php,代码如下: &l...原创 2018-11-23 17:34:43 · 384 阅读 · 0 评论 -
php根据经纬度计算距离
/* * 1.纬度1,经度1,纬度2,经度2 * 2.返回结果是单位是KM。 * 3.保留一位小数 */ function getDistance($lat1,$lng1,$lat2,$lng2) { //将角度转为狐度 $radLat1 = deg2rad($lat1);//deg2rad()函数将角度转换为弧度 $radLat2 = deg2rad($lat2); $radL...转载 2018-06-05 10:33:07 · 3335 阅读 · 0 评论