<dfn id="w48us"></dfn><ul id="w48us"></ul>
  • <ul id="w48us"></ul>
  • <del id="w48us"></del>
    <ul id="w48us"></ul>
  • 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()執(zhí)行相反的操作。

      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 程式在執(zhí)行前,就會先讀入 require 所指定引入的檔案,使它變成 PHP 程式網頁的一部份。常用的函式,亦可以這個方法將它引入網頁中。錯誤產生致命錯誤。

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

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

      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);

      本函數以 正則 的規(guī)則來解析比對字符串 ,欲取而代之的字符串為’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

    主站蜘蛛池模板: 91不卡在线精品国产| 亚洲国产精品日韩| 亚洲AV无码久久精品成人| 日韩精品无码免费视频| 狠狠精品久久久无码中文字幕| 日韩精品免费视频| 91精品国产91热久久久久福利| 日韩AV无码精品人妻系列| 久久夜色精品国产噜噜噜亚洲AV| 日韩精品乱码AV一区二区| 国产精品亚洲аv无码播放| 91精品国产福利在线导航| 精品一区二区三区四区| 国产精品成人免费观看 | 国产在线精品无码二区| 久久久91精品国产一区二区三区 | 久久精品一本到99热免费| 久久久久无码精品国产不卡| 日韩精品久久久久久免费| 国产精品无套内射迪丽热巴| 久久99精品综合国产首页| 国产91久久精品一区二区| 97久人人做人人妻人人玩精品| 青青草原综合久久大伊人精品| 国产91精品黄网在线观看| 久久精品中文字幕有码| 最新欧美性爱精品一区二区三区| 亚洲韩国精品无码一区二区三区| 国产伦精品一区二区三区视频金莲 | 亚洲国产成人一区二区精品区| 国产精品无码无在线观看| 久久91精品国产91久久小草| 办公室久久精品| 久久伊人精品青青草原日本| 国产在线精品一区二区中文| 岛国精品一区免费视频在线观看| 国内精品久久国产大陆| 精品成人av一区二区三区| 日韩人妻精品一区二区三区视频 | 最新国产乱人伦偷精品免费网站| 久久国产精品无码一区二区三区|