PHP Interview Questions and Answers:

In this section, I have selected advanced php interview questions and answers for all levels of candidates(entry level, advanced level, expert level).Last few months I have been working to select best question and answer set for PHP-MySQL interview questions.I have written some php tutorials.

Here is some PHP Interview Questions:
  1. What is the difference between $a and $$a?
  2. What are the differences between Get and post method.
  3. What does a special set of tags do in PHP?
  4. What’s the difference between include and require in PHP?
  5. How do you define a constant?
  6. Will comparison of string and integer work in PHP?
  7. Ternary conditional operator in PHP?
  8. How do I find out the number of parameters passed into function?
  9. How do you call a constructor for a parent class?
  10. What’s the special meaning of __sleep and __wakeup?
  11. Difference in mysql4 and mysql5 ?
  12. Meaning of urlencode and urldecode in php?
  13. Function to check password length in php?
  14. Difference between strstr and stristr in php?
  15. Meaning of Session?
  16. Simple mail in php?
  17. urlencode and urldecode in php?
  18. A .htaccess rule that will divert any page in another folder?
  19. what's difference between in_array() and array_search() in php?
  20. Difference between strstr and stristr in php?
  21. PHP explode() Function?
  22. PHP implode() Function?
  23. What is difference between php explode and implode functions?
  24. How to Send Email from a PHP Script using mail() function.?
  25. How To Send Mail with Attachment in PHP?
  26. Ob_start() function in Php5?
  27. Difference between include and include_once in php?
  28. Difference between php5 and php6?
  29. Difference between php4 and php5?
  30. Difference between mysql4 and mysql5?
  31. How to delete file in PHP?
  32. Difference between mysql_fetch_object and mysql_fetch_array in php?
  33. chdir function in php?
  34. Difference between join and implode in php.?
  35. Check password length in php?
  36. Regular expression Basics in php?
  37. .htaccess file and URL rewrite rule in php?
  38. Difference between strpos and stripos in php?
  39. String declaration in php?
  40. Date function in php?
  41. Meaning of Cookie in Php?
  42. File uploading in php?
  43. Database connection in php?
  44. Concatenation operators in php?
  45. Variable declaration in php?
  46. Meaning of php array?
  47. What is the difference between characters 23 and x23?
  48. Difference between echo, print and printf.
  49. What’s the difference between htmlentities() and htmlspecialchars()?
  50. What’s the difference between md5(), crc32() and sha1() crypto on PHP?
  51. What is the difference between mysql_fetch_object and mysql_fetch_array?
  52. How many ways we can retrieve the data in the result set of MySQL using PHP?
  53. How can we create a database using PHP and MySQL?
  54. Can we use include ("abc.php") two times in a PHP page "index.php"?
  55. What are the different table Engines present in MySQL?
  56. How can I execute a PHP script using command line?
  57. What is use of header() function in php ?
  58. What is meant by nl2br()?
  59. How we get IP address of client, previous reference page?
  60. What are the differences between public, private, protected,static,final and volatile?
  61. What are the different types of errors in PHP?
  62. What is the functionality of the function strstr and stristr?
  63. What are the differences between PHP 3 and PHP 4 and PHP 5?
  64. How can we get second of the current time using date function?
  65. How can we convert the time zones using PHP?
  66. What is meant by urlencode and urldocode?
  67. How can we register the variables into a session?
  68. How can we increase the execution time of a PHP script?
  69. How can we get the browser properties using PHP?
  70. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
  71. How many ways can we get the value of current session id?
  72. How can we get the browser properties using PHP?
  73. How can we destroy the session?
  74. What are the different functions in sorting an array?
  75. How can we know the count/number of elements of an array?
  76. List out the predefined classes in PHP?
  77. What are the difference between abstract class and interface?
  78. How can we send mail using JavaScript?
  79. Explain Normalization concept?
  80. How can we find the number of rows in a result set using PHP?
  81. How many ways we can we find the current date using MySQL?
  82. What type of inheritance that PHP supports?
  83. What is the functionality of md5 function in PHP?
  84. How can we know the number of days between two given dates using PHP?
  85. PHP how to know user has read the email?
  86. What are default session time and path?
  87. what are magic methods?
  88. what is magic quotes?
  89. what is MVC? why its been used?
  90. what is CURL?
  91. What is PHP's mysqli Extension?
  92. Difference between mysql_connect and mysql_pconnect?
  93. What is the use of obj_start()?
  94. What is the difference between session_register and $_session?
  95. How do you capture audio/video in PHP?
  96. How can I maintain the count of how many persons have hit my site?
  97. How would you initialize your strings with single quotes or double quotes?
  98. Would I use print "$a dollars" or "{$a} dollars" to print out the amount of dollars in this example?
  99. How to prevent form hijacking in PHP?
  100. Where does the PHP session stored, either client side or server side?
  101. How can we submit a form without a submit button?
  102. What are new features that are in added in PHP5?
  103. How to handle drop down box change event without refreshing page?
  104. What Is a Persistent Cookie?
  105. What is meant by PEAR in php?
  106. How do we know browser properties?
  107. What is the difference between mysql_fetch_object and mysql_fetch_array?
  108. How do you create subdomains using PHP?
  109. What are the differences between require and include, include_once?
  110. Explain about the data types in PHP?
  111. Explain about switch statement in PHP?
  112. What Is a Session?
  113. Explain about PHP cookies?
  114. What would be the differences between PHP and Java?
  115. Explain about objects in PHP?
  116. What is the difference between $message and $$message?
  117. What is htaccess?
  118. How do you pass a variable by value?
  119. How can i get ip address?
  120. Explain about Functions in PHP?
  121. What is a PHP accelerator?
  122. Define about declare construct?
  123. What is the diffrence between Notify URL and Return URL?
  124. How To Read the Entire File into a Single String?
  125. Explain about Type Juggling in php?
  126. How to get the URL domain name in PHP?
  127. What type of headers have to be added in the mail function to attach a file?
  128. What is the maximum length of a table name, a database name, or a field name in MySQL?
  129. How To Convert Strings to Numbers in PHP?
  130. How To Turn On the Session Support in PHP?
  131. What is the difference between PHP4 and PHP5?
  132. What changes I have to do in php.ini file for file uploading?
  133. How many values can the SET function of MySQL take?

<< Next Page>>