php curl post调用Api获取set-Cookie

php curl post调用Api获取set-Cookie

function post_url($url, $data){$curl = curl_init(); // 启动一个CURL会话 curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查 curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); // 从证书中检查SSL加密算法是否存在 curl_setopt($curl, CURLOPT_USERAGENT, 'Mozill...

PHP 2019-12-11 PM 4552℃ 0条
php冒泡排序(数组排序)

php冒泡排序(数组排序)

//冒泡排序(数组排序) function bubble_sort($array) { $count = count($array); if ($count <= 0) return false; for($i=0; $i<$count; $i++){ for($j=$count-1; $j>$i; $j--){ if ($array[$j] < $array[$j-1]){ $tmp = $array[$j]; $array[$j] = $array[$j-1]; ...

PHP 2019-12-11 PM 2677℃ 0条
php将数组按照 id 和 pid 重新组合为树结构

php将数组按照 id 和 pid 重新组合为树结构

/**$list [array] 原始数组$pk [string] id$pid [string] 父级pid$child [array] 承载子集的容器return [array] 返回树结构**/function list_to_trees($list, $pk='id', $pid = 'pid', $child = 'listArea', $root = 0) { //创建Tree $tree = array(); if (is_array($list)) { //创建基于主键的数组引用 $refer = array(); foreach ($list as $key...

PHP 2019-12-11 PM 3441℃ 0条
php curl模拟post提交

php curl模拟post提交

/** * 模拟POST提交 * @param string $url 地址 * @param string $data 提交的数据 * @return string 返回结果 */ function post_url($url, $data) { $curl = curl_init(); // 启动一个CURL会话 curl_setopt($curl, CURLOPT_URL, $url); // 要访问的地址 curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); // 对认证证书来源的检查 cur...

PHP 2019-12-11 PM 2482℃ 0条
PHP人民币金额大写转换类

PHP人民币金额大写转换类

class Num2Cny{ static $basical = array(0=>"零","壹","贰","叁","肆","伍","陆","柒","捌","玖"); static $advanced=array(1=>"拾","佰","仟"); public static function ParseNumber($number){$number=trim($number); if ($number>999999999999) return "数字太大,无法处理。抱歉!"; if ($number==0) return "零&quo...

PHP 2019-12-11 PM 2078℃ 0条
PHP 获取当前浏览器类型

PHP 获取当前浏览器类型

/**获取当前浏览器类型@return [type] [description] */function my_get_browser(){ if(empty($_SERVER['HTTP_USER_AGENT'])){ return 'robot!'; } if( (false == strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) && (strpos($_SERVER['HTTP_USER_AGENT'], 'Trident')!==FALSE) ){ return 'Internet Explorer 11.0'; ...

PHP 2019-12-11 PM 2017℃ 0条
ESP32进入wifi的STA和AP混合模式进行配网(micropython环境)

ESP32进入wifi的STA和AP混合模式进行配网(micropython环境)

使ESP32进入wifi的STA和AP混合模式进行配网(micropython环境) 我们在用ESP32做开发时,由于初始化配网的需要,往往是需要工作在AP模式,但是也要能使用STA模式的扫描功能,列出周围可用的wifi热点列表,方便用户通过选择的方式输入热点名。这就需要进入STA和AP的混合模式。 但是,在micropython的标准文档中,wifi的模式只有STA和AP两种模式,似乎没有混合模式。并且STA模式和AP模式的切换很容易出现扫描不到周围的wifi热点、wifi模块报unknown error 0x0102错误导致wifi模块失效等问题。 为此,笔者经过...

MicroPython 2019-12-11 PM 4145℃ 0条
js 强制跳转https

js 强制跳转https

var matchStr =window.location.href; var reURL = /^(https):\/\/.+$/; if(!reURL.test(matchStr)){ window.location.href = "https://www.1231818.com/"; }

前端 2019-12-02 AM 3301℃ 0条
js 判断客户端自动跳转

js 判断客户端自动跳转

方法1: try { if (location.search.indexOf('?pc') !== 0 && /Android|Windows Phone|iPhone|iPod/i.test(navigator.userAgent)) { window.location.href = 'https://xw.qq.com?f=qqcom'; } } catch (e) {} 方法2: var sUserAgent = navigator.userAgent, mobileAgents = ['Windows CE', 'iPod'...

前端 2019-12-02 AM 2847℃ 0条
jQuery+AJAX+PHP+MySQL数据库开发搜索功能,无跳转无刷新搜索

jQuery+AJAX+PHP+MySQL数据库开发搜索功能,无跳转无刷新搜索

index.html<!DOCTYPE html><meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>AJAX搜索</title> <style type="text/css"> *{margin:0px;padding:0px;} h2{ text-align: center; } ...

PHP 2019-11-09 PM 2846℃ 0条
ajax ,jquery,php实现查找并更新显示数据

ajax ,jquery,php实现查找并更新显示数据

<!DOCTYPE html><head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="js/jquery.min.js"></script> <script> $(function() { $("#name").on("keyup&q...

PHP 2019-11-09 PM 1733℃ 0条