中文字幕在线一区二区在线,久久久精品免费观看国产,无码日日模日日碰夜夜爽,天堂av在线最新版在线,日韩美精品无码一本二本三本,麻豆精品三级国产国语,精品无码AⅤ片,国产区在线观看视频

      PHP面試題附答案

      時間:2023-04-05 10:18:10 筆試題目 我要投稿
      • 相關推薦

      PHP面試題附答案

        1. Which of the following will not add john to the users array?

      PHP面試題附答案

        1. $users[] = ‘john’;

        2. array_add($users,’john’);

        3. array_push($users,’john’);

        4. $users ||= ‘john’;

        Answer: 2,4

        2. What’s the difference between sort(), asort() and ksort(),rsort()? Under what circumstances would you use each of these?

        sort(): 本函數對數組的值進行排序。當本函數結束時數組單元將被從最低到最高重新安排,array 中的單元賦予新的鍵名。這將刪除原有的鍵名而不僅是重新排序。

        asort(): 這個函數將數組的值重新排序,由小至大排列。數組的索引亦跟著值的 順序而變動。當您在程序中需要重新整理數組值的 順序時,就可以使用這個函數。

        ksort(): 對數組按照鍵名排序,保留鍵名到數據的關聯。本函數主要用于關聯數組。

        rsort(): 本函數對數組進行逆向排序(最高到最低)。與sort()執行相反的操作。

        3. What would the following code print to the browser? Why?

        $num = 10;

        function multiply(){

        $num = $num * 10;

        }

        multiply();

        echo $num;

        10

        4. What is the difference between a reference and a regular variable? How do you pass by reference & why would you want to?

        pass by reference like this functions(&$vars);

        it likes more fast;

        5. What functions can you use to add library code to the currently running script?

        inlcude() or require();

        6. What is the difference between foo() & @foo()?

        if foo() throw a error, will be alert, but @foo() no;

        7. How do you debug a PHP application?

        xdebug or use die() do it;

        8. What does === do? What’s an example of something that will give true for ‘==’, but not ‘===’?

        === 用于精確比較 ex: (” == null) => true but ( ”===null) =>false;

        9. How would you declare a class named “myclass” with no methods or properties?

        class myclass{

        }

        10. How would you create an object, which is an instance of “myclass”?

        $myoject = new myclass();

        11. How do you access and set properties of a class from within the class?

        getVar() or setVar() ;

        12. What is the difference between include & include_once? include & require?

        require:PHP 程式在執行前,就會先讀入 require 所指定引入的檔案,使它變成 PHP 程式網頁的一部份。常用的函式,亦可以這個方法將它引入網頁中。錯誤產生致命錯誤。

        include:這個函式一般是放在流程控制的處理區段中。PHP 程式網頁在讀到 include 的檔案時,才將它讀進來。這種方式,可以把程式執行時的流程簡單化。錯誤產生警報。

        include_once:此行為和include()語句類似,唯一區別是如果該文件中的代碼已經被包含了,則不會再次包含。如同此語句名字暗示的那樣,只會包含一次。

        13. What function would you use to redirect the browser to a new page?

        1. redir()

        2. header()

        3. location()

        4. redirect()

        2

        14. What function can you use to open a file for reading and writing?

        1. fget();

        2. file_open();

        3. fopen();

        4. open_file();

        3

        15. What’s the difference between mysql_fetch_row() and mysql_fetch_array()?

        mysql_fetch_row():返回根據所取得的行生成的數組,如果沒有更多行則返回 FALSE。

        mysql_fetch_array(): 是mysq_fetch_row()的擴展版本。除了將數據以數字索引方式儲存在數組中之外,還可以將數據作為關聯索引儲存,用字段名作為鍵名。

        16. What does the following code do? Explain what’s going on there.

        $date=’08/26/2003′;

        print ereg_replace(‘([0-9]+)/([0-9]+)/([0-9]+)’,’2/1/3′,$date);

        本函數以 正則 的規則來解析比對字符串 ,欲取而代之的字符串為’2/1/3′。

        返回值為字符串類型,為取代后的字符串結果。

        17. Given a line of text $string, how would you write a regular expression to strip all the HTML tags from it?

        strip_tags

        18. What’s the difference between the way PHP and Perl distinguish between arrays and hashes?

        19. How can you get round the stateless nature of HTTP using PHP?

        20. What does the GD library do?

        21. Name a few ways to output (print) a block of HTML code in PHP?

        22. Is PHP better than Perl? – Discuss.

        如果成功則返回 TRUE,失敗則返回 FALSE。

      【PHP面試題附答案】相關文章:

      騰訊php程序員面試題目及答案08-03

      關于PHP面試題的分享11-20

      PHP筆試題及答案02-11

      Linux系統工程師面試題(附答案)03-02

      絕對出乎意料!Intel公司的最新面試題(附答案)11-06

      PHP筆試題含答案02-11

      CAD試卷「附答案」04-29

      photoshop試題附答案12-19

      蘋果面試題及答案11-13

      面試題目及答案02-15

      主站蜘蛛池模板: 国产粉嫩嫩00在线正在播放| 国产剧情麻豆一区二区三区亚洲| 免费在线视频精品自拍| 青青草综合影院在线观看| 黑水县| 亚洲综合色一区二区三区| 尤物yw午夜国产精品视频| 亚洲大片中文字幕久久| 栾川县| 临泽县| 高清一级淫片a级中文字幕| 免费国产在线精品三区| 97人妻精品一区二区三区免 | 国产免费人成视频在线观看播放| 人妻av一区二区三区高| 亚洲狠狠婷婷综合久久久| 国产日韩欧美视频成人| 精品亚洲一区二区视频| 亚洲中文字幕在线精品一区| 精品三级久久久久久久| 中文字幕少妇人妻视频| 葫芦岛市| 97精品国产高清自在线看超| 涞源县| 在线视频一区二区亚洲| 男人午夜a天堂一区二区三区| 亚洲成熟丰满熟妇高潮XXXXX| 突泉县| 国产女主播福利一二区| 沧州市| 丰满人妻无奈张开双腿av| 无码av永久免费大全| av在线免费播放网站| 久久久久久久久国内精品影视| 日韩一区二区三区中文字幕| a√无码在线观看| 中文字幕午夜AV福利片| 91在线视频视频在线| 96精品免费视频大全| 国产中文久久精品| 赫章县|