PHP 使用 获取网页内容:
if (! preg_match('@^https?://@', $url)) {
die('HTTP(s) only.');
}
$httpOpts = array(
'max_redirects' => 0
,'timeout' => 3
);
if ($ua !== '') {
$httpOpts['user_ag...
分类:
Web程序 时间:
2014-11-18 10:21:31
阅读次数:
273
ua: function () { return navigator.userAgent.toLowerCase() }, isMobile: function () { return M.ua().match(/iPhone|iPad|iPod|Android|IEMobile/i) }, isA...
分类:
Web程序 时间:
2014-11-17 13:46:27
阅读次数:
164
界面activity_main.xml<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_..
分类:
移动开发 时间:
2014-11-17 12:31:37
阅读次数:
295
/etc/vim/vimrcset showmatch "bracket matchset matchtime=5 "bracket match time 5 set ignorecase "ingnore upper and lower when seekset incsearch set for...
分类:
系统相关 时间:
2014-11-17 10:39:01
阅读次数:
193
Android下一行平均分布图片的布局
这是一个很常见的需求,比如有三个图片按钮,需要在底部三个平均,比如下个例子:
以下是布局文件
LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout...
分类:
移动开发 时间:
2014-11-16 07:09:24
阅读次数:
4708
publicfunctionisEmail($email){//验证邮箱 $chars="/([a-z0-9]*[-_\.]?[a-z0-9]+)*@([a-z0-9]*[-_]?[a-z0-9]+)+[\.][a-z]{2,3}([\.][a-z]{2})?/i"; if(preg_match($chars,$email)){ returntrue; }else{ returnfalse; } }
分类:
Web程序 时间:
2014-11-14 18:07:09
阅读次数:
217
function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg)...
分类:
Web程序 时间:
2014-11-13 18:37:05
阅读次数:
144
网上关于 Url 转链接( href )的正则表达式一搜一大堆,但真正好用的没几个。后来在 Matthew O'Riordan 的Blog上发现一个很好用的正则表达式,是用 Javascript 写的,代码如下: 1 ( // brackets covering match for proto...
界面文件activity_main.xml<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activ..
分类:
移动开发 时间:
2014-11-13 07:13:53
阅读次数:
240
界面activity_main.xml<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_..
分类:
移动开发 时间:
2014-11-13 07:13:43
阅读次数:
253