You are here: 首頁 文章分類選單

飛朵啦學習手札

本網站建議使用Firefox2.0以上,或是使用Goole瀏覽器來瀏覽,並使用1024x768解析度來觀看.

飛朵啦學習手札

03

[轉貼]PHP - Filter Functions 過濾器

E-mail 列印 PDF

本文章轉貼自:http://ianjung1974.blogspot.com/search/label/PHP


在以往要檢查 E-mail 格式是否正確,我們通常都是透過寫正規表示式來做判斷,如下︰

  1. $email = " 這個 E-mail 地址已經被防止灌水惡意程式保護,您需要啟用 Java Script 才能觀看 ";
  2. if( eregi("^[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,6}$", $email) )
  3. echo "這是正確的 E-mail";
  4. else
  5. echo "這是不正確的 E-mail";

但在 PHP5 之後,可以直接透過 Filter 函數,有更方便的作法,如下︰
  1. $email = " 這個 E-mail 地址已經被防止灌水惡意程式保護,您需要啟用 Java Script 才能觀看 ";
  2. if( filter_var($mail, FILTER_VALIDATE_EMAIL) )
  3. echo "這是正確的 E-mail";
  4. else
  5. echo "這是不正確的 E-mail";

 
 
17

PHP好用的圖片生成JpGraph

E-mail 列印 PDF

JPGraph 是一套以 PHP 開發的繪圖函式庫,幫助許多 PHP 網上應用程式製作出各種不同的圖表,網上有很介紹,真的很方便使用,以下兩張圖片就是由其生成而成。

參考連結:
官方網站http://jpgraph.net/
中文講解http://www.coolsun.idv.tw/modules/xhnewbb/viewtopic.php?topic_id=1239

最近更新 ( 週四, 17 六月 2010 16:17 )
 
 
15

Google的JavaScrip 的壓縮

E-mail 列印 PDF

想要看其他的壓縮可以參考此篇http://pim0110.webhop.org/joomla/index.php/javascript/122-javascript-

Google Closure Compiler 提供三種壓縮方法,分別是空格移除、簡單壓縮及進階壓縮。簡單壓縮基本上只是把 comments 和空格拿走(跟 YUI Compressor 基本一樣);進階壓縮除以上功能外,還能夠 rename variable name、甚至重寫某些 statement!很好很強大!

Google JavaScript Closure Compiler 有單機版和線上版兩款:

  1. 按此下載 Javascript Closure Compiler
  2. 網上版 Javascript Closure Compiler

附官方英文版簡介:

Closure Compiler is a JavaScript optimizing compiler. It parses your JavaScript, analyzes it, removes dead code and rewrites and minimizes what’s left. It also checks syntax, variable references, and types, and warns about common JavaScript pitfalls. It is used in many of Google’s JavaScript apps, including Gmail, Google Web Search, Google Maps, and Google Docs.

 

 
17

windows 7的快速啟動

E-mail 列印 PDF

剛灌完WINDOW7 發現沒有快速啟動,因此這邊坐一下筆記。

 

1.要在工作列上按右鍵,選擇 工作列 / 新增工作列。

windows 7快速啟動

2.之後輸入%appdata%\Microsoft\Internet Explorer\Quick Launch

最近更新 ( 週三, 17 二月 2010 22:07 )
 
更多文章...
第 19 頁, 共 30 頁