1. 程式人生 > >廣州酷狗php面試題(賦答案)

廣州酷狗php面試題(賦答案)

1.Linux下顯示當前目錄下所有檔案的詳細資訊,包含隱藏檔案

ls -la

2.Linux下靜態庫檔案和動態庫檔案的副檔名?

靜態庫檔案.a 動態庫檔案.so

3.Linux下軟體編譯安裝的基本步驟,並寫出每個步驟的註解

4.Linux下vi/vim有幾種模式,分別是什麼。

三種方式: 命令方式,插入方式, 命令列方式

5.Linux下vi/vim中刪除一行資料和刪除當前游標後到行末的資料用什麼命令?

0d$刪除一行資料,d$刪除當前游標後到行末的資料

6. Linux下網路配置檔案目錄?(假設eth0是網路裝置)

/etc

7.Linux下修改/usr/local目錄下的檔案file的許可權為755,修改/home/th1下的所有檔案的所有者和組為th1和ggv?

chmod 755 /usr/local/file

chown th1:ggv /home/th1/*

8.mysql中建立表user的指令碼?

user(uid,name,groupid)其中groupid是外來鍵

create table user(

uid int not null auto_increment,

name var100) not null,

groupid int not null,

primary key(uid),

foreign key(groupid) references group(groupid) on cascade

)

9. mysql命令列下連線資料庫,選擇資料庫test,查詢表user結構,查詢資料庫test的所有表資訊?

mysql -u root -p (連線本地mysql資料庫,提示輸入密碼)

mysql -u root -h db.imainary.com -p (連線遠端資料庫,提示輸入密碼)

連線之後到mysql>命令提示符下:

mysql>use test(選擇test資料庫)

mysql>connect test localhost(連線到本地資料庫test)

mysql>describe user(顯示錶user的結構)

mysql>show tables(顯示資料庫test的所有表資訊)

10.php包含外部檔案的函式有哪些?

include() ; include_once(); require(); require_once();

11.php防止sql注入式攻擊,用什麼函式轉換字串?

addslashes();

12.你常用的php字串函式?

substr(),strtolower(),ucwords(),ucfirst(),strtoupper(),implode(),explode(),str_replace(),strpos(),strrev()

13.php儲存序列化物件到session中,並可以從session中獲取序列化物件的值,用什麼序列化函式?

serialize()函式序列化物件; unserialize()函式還原序列化物件。

14.常用的mysql工具?

phpmyadmin; Navicat for mysql

15.php程式中連線資料庫,host是localhost,賬號是root, 密碼是123,查詢資料庫test中表user的記錄並顯示出來,?

$connect= mysql_connect("localhost","root","123");

$sql="select * from user";

$query=mysql_query("test",$sql,$connect);

while($result=mysql_fetch_array($query)){

echo ...;

}

mysql_close($connect);

16.php的快取機制,舉例說明?

17.如何構建1千萬點選率的網站

18.以下php程式的結果

8%-3=?; =>2

$a="hello";

$b=&$a;

unset($b);

$b="world";

$a=? ; =>"hello"

19.HTTp的通訊協議是?

TCp

20. VSFTp的通訊協議?

21.php中的檔案讀寫操作,讀取檔案test.txt中前300位元組的內容?

$handle=fopen("test.txt","r");

$contents=fread($handle,300);

fclose($handle);