2017年4月21日

FFmpeg

摘要: ffmpeg -i F:\Factory\share.mov -drop_frame_timecode 1 -vcodec libx264 -pix_fmt yuv420p -s 640x968 -y F:\Factory\new.mp4 1、安装 命令行 cmd 操作 参考链接:http://ww 阅读全文

posted @ 2017-04-21 14:25 ds516 阅读(106) 评论(0) 推荐(0) 编辑

2017年3月17日

根据经纬度查询当前地点,百度google接口

摘要: <?php /** 百度 API 根据经纬度查询当前地点 **/ header("Content-Type: text/html; charset=UTF-8"); function getBaiduAPIAddress($lat,$lng){ //纬度,经度 $location = $lat.', 阅读全文

posted @ 2017-03-17 10:32 ds516 阅读(459) 评论(0) 推荐(0) 编辑

取数组中随机元素

摘要: $array=array("red","green","blue","yellow","brown"); $random_keys=array_rand($array,2); echo $array[$random_keys[0]]; 阅读全文

posted @ 2017-03-17 10:31 ds516 阅读(330) 评论(0) 推荐(0) 编辑

2017年3月8日

PHP获取当前页面url

摘要: 测试网址: http://localhost/blog/testurl.php?id=5 //获取域名或主机地址 echo $_SERVER['HTTP_HOST']."<br>"; #localhost //获取网页地址 echo $_SERVER['PHP_SELF']."<br>"; #/bl 阅读全文

posted @ 2017-03-08 15:35 ds516 阅读(150) 评论(0) 推荐(0) 编辑

2016年12月5日

冒泡

摘要: <?php$arr = array(1, 43, 54, 72, 21, 66, 32,55,11, 78, 36, 76, 39,88);function getpao($arr) { $len = count($arr); //设置一个空数组 用来接收冒出来的泡 //该层循环控制 需要冒泡的轮数 阅读全文

posted @ 2016-12-05 11:23 ds516 阅读(79) 评论(0) 推荐(0) 编辑

2016年10月24日

PHP5中使用PDO连接数据库的方法

摘要: 1.PDO简介 PDO(PHP Data Object) 是PHP 5 中加入的东西,是PHP 5新加入的一个重大功能,因为在PHP 5以前的php4/php3都是一堆的数据库扩展来跟各个数据库的连接和处理,什么 php_mysql.dll、php_pgsql.dll、php_mssql.dll、p 阅读全文

posted @ 2016-10-24 11:09 ds516 阅读(137) 评论(0) 推荐(0) 编辑

2016年9月28日

js循环遍历

摘要: //获取多个用户id 一般用在复选框 cust_id = 1,2,3,4; var str = cust_id.split(","); for (var key in str) { $("#jsCust" + str[key]).remove(); $("#jsCustTR" + str[key]) 阅读全文

posted @ 2016-09-28 16:51 ds516 阅读(129) 评论(0) 推荐(0) 编辑

2016年9月9日

判断网页中英文

摘要: function Get_Lang() { if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { $lang = $_SERVER['HTTP_ACCEPT_LANGUAGE']; $lang = substr($lang, 0, 5); if (preg_ 阅读全文

posted @ 2016-09-09 11:12 ds516 阅读(273) 评论(0) 推荐(0) 编辑

2016年4月21日

PHP记录点击数方法

摘要: 1.第一种方法: $id = $_GET['id']; //获取文章ID$sql = "UPDATE base SET hits = hits+1 WHERE id = '$id'"; //数据库的执行语句header("location: read.php?id=$id"); //跳转语句给你思路 阅读全文

posted @ 2016-04-21 17:53 ds516 阅读(2050) 评论(0) 推荐(0) 编辑

2016年4月19日

PHP实现简单爬虫

摘要: <?php /** * 爬虫程序 -- 原型 * * 从给定的url获取html内容 * * @param string $url * @return string */ function _getUrlContent($url) { $handle = fopen($url, "r"); if ( 阅读全文

posted @ 2016-04-19 14:24 ds516 阅读(233) 评论(0) 推荐(0) 编辑

导航