Day: October 23, 2017

PHP: 通过字母大小写分割字符,大写字符分割到数组, php explode at capital letters?

I have strings like, $a = 'helloMister'; $b = 'doggyWaltz'; $c = 'bumWipe'; $d = 'pinkNips'; How can I explode at the capital letters, search on google for some time and came back with nothing! Thanks. 解决: If you want to split helloMister into hello and Mister you can use preg_split to split the string at a point just before the uppercase letter

Mysql: 格式化日期, 时间戳到日期, Convert timestamp to date in MySQL query

定义和用法 DATE_FORMAT() 函数用于以不同的格式显示日期/时间数据。 语法 DATE_FORMAT(date,format) date 参数是合法的日期。format 规定日期/时间的输出格式。 实例 下面的脚本使用 DATE_FORMAT() 函数来显示不同的格式。我们使用 NOW() 来获得当前的日期/时间: DATE_FORMAT(NOW(),'%b %d %Y %h:%i %p') DATE_FORMAT(NOW(),'%m-%d-%Y') DATE_FORMAT(NOW(),'%d %b %y') DATE_FORMAT(NOW(),'%d %b %Y %T:%f') 结果类似: Dec 29 2008 11:45 PM 12-29-2… Read More

获取访问者的IP, 定位访问中IP,Geoip DB

How to use? Geoip-db.com allows you to find out the geographic location of your website’s visitor by IP address. Easily identify the location, country, city, hostname, network owner and other characteristics of your Internet users by using one of our services. We provide two kind of services, either a JSON-object or JSONP callback function is retu…

添加holiday假日到fullcalendar ,Add Holiday Calendars to Full Calendar

如果你使用fullcalendar,添加holiday假日的方法如下: googleCalendarApiKey : 'PUT-YOUR-GOOGLE-API-HERE', // google api key eventSources: [ {url:'https://www.google.com/calendar/feeds/en.usa#holiday@group.v.calendar.google.com/public/basic',cache:true}, // us holiday {url:'https://www.google.com/calendar/feeds/zh.china#holiday@grou… Read More

改造FullCalendar增加节气、节日和农历显示, add lunar for FullCalendar

网上看了FeiFei些的《fullCalendar改造计划之带农历节气节假日的万年历》文章,按照他的方法改造发现他用的是老版本的插件,新版本代码结构变动很大,无奈自己重新读源码改造之,记录下来,给有需求的朋友一点参考。 FullCalendar官网(https://fullcalendar.io/) 改造使用新的版本,v 3.0.1。 首先看下改造成功后的预览图吧: 一、汉化 现在插件已经自带了本地化文件,所以直接加载插件包中的locale/zh-cn/js即可。 二、增加农历,节气,节假日显示 关于直接调用Google Calendar的订阅我就不说了,墙的厉害。 下面说说直接修改源文件,这个就麻烦点,不过自定… Read More

创建Google API Key, Creating a Google API Key

To read events from your public Google Calendars you’ll need create a Google API key and save within your plugin settings. Here are step-by-step instructions to create and save a Google API key: 1Navigate to the Google Developers Console. 2 From the top Project menu select Create project. 3Give your project a name, agree to the terms, then click Create. 4…

JQuery: 提交表单数据,转换表单数据为json,values of Form to Json (jquery.serializeJSON)

项目:https://github.com/marioizquierdo/jquery.serializeJSON 下载:jquery.serializeJSON-master jquery.serializeJSON 前端在处理含有大量数据提交的表单时,除了使用Form直接提交刷新页面之外,经常碰到的需求是收集表单信息成数据对象,Ajax提交。 而在处理复杂的表单时,需要一个一个区手动判断处理字段值,显得非常麻烦。接下来介绍的插件将解决这个问题。 使用jquery.serializeJSON,可以在基于jQuery或者Zepto的页面中,调用 .serializeJSON() 方法来序列化form表单… Read More

JavaScript 日期处理类库: Moment.js 写法示例(详解)

主页:http://momentjs.cn/ 文档:http://momentjs.cn/docs/ 项目地址:https://github.com/moment/moment/ 下载:moment-develop 引用: http://sources.ikeepstudying.com/js/moment-2.10.6.js  (未压缩) http://sources.ikeepstudying.com/js/moment.min-2.18.1.js (压缩版) http://sources.ikeepstudying.com/js/moment-with-locales-2.10.6.js (支持多语言) &… Read More