1. 程式人生 > >Alex SUN's Blog

Alex SUN's Blog

/*************by garcon1986****************/

1. PHP的特點:
快速開發,面向物件,跨平臺,適合中小企業應用的web開發語言

2. 如何在MySQL中優化SQL的查詢時間
1)如果沒有特殊需要,使列長儘量短。如:如果列長最長是40位,不要使用char(255)
使用適合的儲存引擎。例如MyISAM資料表,最好用定長的列代替變長的列,不適用varchar()。 固定長度的資料行被處理的速度更快!但是佔用的空間也更大。

如果空間很重要就用varchar,如果時間更重要就用char。

可以用Optimize table維護表格。
2)對於InnoDB表格來說,內部的行儲存格式不分固定長度列和可變長度列。因此最好使用varchar。
3)使用索引。
4)優化where子句。如刪除不必要的括號

3. PHP連線mysql資料庫的指令碼
$conn = mysql_connect("localhost","user","password");

4. PHP使用Select並得到查詢結果的指令碼
$query = "select * from testable";
mysql_query($query);

5. PHP控制email的正則表示式
preg_replace

6. 如何獲得表單裡的資料
$_GET,$_POST, $_COOKIE, $_REQUEST(儘量不要使用)
使用$_REQUEST可以不管資料的來源是get,post還是cookie。
EGPCS就是說明用$_REQUEST陣列獲取內容的優先順序,其字母的含義分別代表為:E代表$_ENV,G代表$_GET,P代表$_POST,C代表$_COOKIE,S代表$_SESSION。後面出現的資料會覆蓋前面寫入的資料,其預設的資料寫入方式就是EGPCS。

7. 如何獲得SESSION資料
$_SESSION

8. 如何獲得正在執行的指令碼檔名
$_SERVER['PHP_SELF']
$_SERVER['SCRIPT_NAME']

9. 什麼是cron
linux下的定時執行工具

10. javascript如何發郵件

11. 列舉至少3種PHP排序函式
sort(), asort(), rsort(), arsort(), ksort(), krsort()

12. 列舉傳輸協議
HTTP/HTTPS, UDP, FTP/FTPS

13. 什麼是APACHE
第一種解釋:
The Apache Software Foundation Community-led development since 1999.
Apache軟體基金會是自1999年以來的一個社群性的開發團體。
第二種解釋:
The Apache HTTP Server Project is an effort to develop and maintain an open-source HTTP server for modern operating systems including UNIX and Windows NT. The goal of this project is to provide a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards.
Apache HTTP Server是一個致力於為現代作業系統包括Unix和Windows NT等系統開發和維護開源HTTP伺服器的專案。專案的目標是為了提供一個安全有效可擴充套件的伺服器,在目前的HTTP標準下提供HTTP服務。
Apache httpd has been the most popular web server on the Internet since April 1996, and celebrated its 15th birthday as a project this February.
Apache httpd自從1996年來一直是最流行的網路伺服器。


The Apache HTTP Server ("httpd") is a project of The Apache Software Foundation.
Apache HTTP server是一個ASF的專案。

TOMCAT

Apache Tomcat is an open source software implementation of the Java Servlet and JavaServer Pages technologies. The Java Servlet and JavaServer Pages specifications are developed under the Java Community Process.
Apache Tomcat是一個Java Servlet和JavaServer Pages(JSP)技術的開源軟體的實現。

Apache Tomcat is developed in an open and participatory environment and released under the Apache License version 2. Apache Tomcat is intended to be a collaboration of the best-of-breed developers from around the world. We invite you to participate in this open development project.
Apache Tomcat在Apache許可版本2下開發的。

Apache Tomcat powers numerous large-scale, mission-critical web applications across a diverse range of industries and organizations. Some of these users and their stories are listed on the PoweredBy wiki page.

14. 面嚮物件語言的優勢
封裝(encapsulation),多型(polymorphism),繼承(inheritance)

15. 什麼是SVN
Subversion is an open source version control system.

16. 列舉PHP framework
zend, symphony, ez publish, spip, CodeIgniter, cakePHP, Prado

17. PRADO
PRADO is a component-based and event-driven framework for rapid Web programming in PHP 5. PRADO reconceptualizes Web application development in terms of components, events and properties instead of procedures, URLs and query parameters.
PRADO是一個基於元件的和事件驅動的框架。