general php interview questions

  1. What is PHP?
  2. What is PEAR in php?
  3. Explain how to submit form without a submit button.Echo vs. print statement.
  4. why we use curl in php
  5. What is MIME?
  6. What is current version of php and what is difference between 5.0 and 5.5 version
  7. Explain the difference between $message and $$message?
  8. How to set cookies in PHP?
  9. What is the difference between include and require?
  10. What is urlencode and urldecode?
  11. What are the different types of errors in PHP?
  12. Explain how to submit form without a submit button.
  13. What are the functions for IMAP?
  14. How can we increase the execution time of a php script?
  15. What is Type juggle in php?
  16. What is the difference between mysql_fetch_object and mysql_fetch_array?
  17. What is the difference between the functions unlink and unset?
  18. What is Joomla in PHP?
  19. What is zend engine?
  20. What is the difference between Split and Explode?
  21. What is the difference between echo and print statement?
  22. What is CAPTCHA?
  23. What is difference between developing website using PHP and JAVA?
  24. How do you create sub domains using PHP?
  25. How to upload files using PHP?
  26. What is the difference between Notify URL and Return URL?
  27. Describe functions STRSTR() and STRISTR.
  28. What are the various methods to pass data from one web page to another web page?
  29. Explain how to execute a PHP script using command line.
  30. How can we increase the execution time of a PHP script?
  31. Explain the purpose of output buffering in PHP.
  32. Describe session in PHP.
  33. How can we know the number of days between two given dates using PHP?
  34. What is the difference between $a and $$a?
  35. What are the differences between Get and post method.
  36. What does a special set of tags do in PHP?
  37. What’s the difference between include and require in PHP?
  38. How do you define a constant?
  39. Will comparison of string and integer work in PHP?
  40. Ternary conditional operator in PHP?
  41. How do I find out the number of parameters passed into function?
  42. How do you call a constructor for a parent class?
  43. What’s the special meaning of __sleep and __wakeup?
  44. Difference in mysql4 and mysql5 ?
  45. what is difference between php and phtml
  46. Function to check password length in php?
  47. Difference between strstr and stristr in php?
  48. what is difference between require once and require ?
  49. what is simple mail in php?
  50. Give an example of Encapsulation
  51. .htaccess rule that will divert any page in another folder?
  52. what’s difference between in_array() and array_search() in php?
  53. Difference between strstr and stristr in php?
  54. What are magic methods in php?
  55. Is __CONSTRUCT is a default keyword in PHP?
  56. What is difference between php explode and implode functions?
  57. How to Send Email from a PHP Script using mail() function.?
  58. How To Send Mail with Attachment in PHP?
  59. What is Ob_start() function in Php5?
  60. Difference between include and include_once in php?
  61. Difference between php5 and php6?
  62. What is difference between mysql4 and mysql5?
  63. What is Difference between php4 and php5?
  64. How to delete file in PHP?
  65. Difference between mysql_fetch_object and mysql_fetch_array in php?
  66. chdir function in php?
  67. Difference between join and implode in php.?
  68. Check password length in php?
  69. Regular expression Basics in php?
  70. Can we maintain we website without .htaccess in php
  71. Difference between strpos and stripos in php?
  72. String declaration in php?
  73. Date function in php?
  74. Meaning of Cookie in Php?
  75. File uploading in php?
  76. Database connection in php?
  77. Concatenation operators in php?
  78. Variable declaration in php?
  79. Meaning of php array?
  80. What is the difference between characters 23 and x23?
  81. Difference between echo, print and printf.
  82. What’s the difference between htmlentities() and htmlspecialchars()?
  83. What’s the difference between md5(), crc32() and sha1() crypto on PHP?
  84. What is the difference between mysql_fetch_object and mysql_fetch_array?
  85. How many ways we can retrieve the data in the result set of MySQL using PHP?
  86. How can we create a database using PHP and MySQL?
  87. Can we use include (“abc.php”) two times in a PHP page “index.php”?
  88. What are the different table Engines present in MySQL?
  89. How can I execute a PHP script using command line?
  90. What is use of header() function in php ?
  91. What is meant by nl2br()?
  92. How we get IP address of client, previous reference page?
  93. What are the differences between public, private, protected,static,final and volatile?
  94. What are the different types of errors in PHP?
  95. What is the functionality of the function strstr and stristr?
  96. What are the differences between PHP 3 and PHP 4 and PHP 5?
  97. How can we get second of the current time using date function?
  98. How can we convert the time zones using PHP?
  99. What is meant by urlencode and urldocode?
  100. How can we register the variables into a session?
  101. How can we increase the execution time of a PHP script?
  102. How can we get the browser properties using PHP?
  103. What is the maximum size of a file that can be uploaded using PHP and how can we change this?
  104. How many ways can we get the value of current session id?
  105. How can we get the browser properties using PHP?
  106. How can we destroy the session?
  107. What are the different functions in sorting an array?
  108. How can we know the count/number of elements of an array?
  109. List out the predefined classes in PHP?
  110. What are the difference between abstract class and interface?
  111. How can we send mail using JavaScript?
  112. Explain Normalization concept?
  113. How can we find the number of rows in a result set using PHP?
  114. How many ways we can we find the current date using MySQL?
  115. What type of inheritance that PHP supports?
  116. What is the functionality of md5 function in PHP?
  117. How can we know the number of days between two given dates using PHP?
  118. PHP how to know user has read the email?
  119. What are default session time and path?
  120. What is polymorphism in php
  121. what is magic quotes?
  122. what is MVC? why its been used?
  123. What is api?
  124. What is PHP’s mysqli Extension?
  125. Difference between mysql_connect and mysql_pconnect?
  126. What is the use of obj_start()?
  127. What is the difference between session_register and $_session?
  128. How do you capture audio/video in PHP?
  129. How can I maintain the count of how many persons have hit my site?
  130. How would you initialize your strings with single quotes or double quotes?
  131. Would I use print “$a dollars” or “{$a} dollars” to print out the amount of dollars in this example?
  132. How to prevent form hacking in PHP?
  133. Where does the PHP session stored, either client side or server side?
  134. what is difference between php3.0 and 5.4
  135. What are new features that are in added in PHP5?
  136. How to handle drop down box change event without refreshing page?
  137. What Is a Persistent Cookie?
  138. what is aggregation in php? Give some example?
  139. How do we know browser properties?
  140. What is the difference between mysql_fetch_object and mysql_fetch_array?
  141. What is inheritance in php? Give some example?
  142. What are the differences between require and include, include_once?
  143. Explain about the data types in PHP?
  144. Explain about switch statement in PHP?
  145. What is taken for var_dump()?
  146. How errors are enabled for view in PHP?
  147. What is best engine for PHP with respect to transaction point?
  148. Explain about objects in PHP?
  149. are there literals in PHP?
  150. What is htaccess?
  151. How do you pass a variable by value?
  152. How can we get ip address in PHP?
  153. Explain about Functions in PHP?
  154. What is a PHP accelerator?
  155. Define about declare construct?
  156. What is the diffrence between Notify URL and Return URL?
  157. How To Read the Entire File into a Single String?
  158. Explain about Type Juggling in php?
  159. How to get the URL domain name in PHP?
  160. What type of headers have to be added in the mail function to attach a file?
  161. What is the maximum length of a table name, a database name, or a field name in MySQL?
  162. How To Convert Strings to Numbers in PHP?
  163. How To Turn On the Session Support in PHP?
  164. What is __sleep method in PHP?
  165. What changes I have to do in php.ini file for file uploading?
  166. How many values can the SET function of MySQL take? What is T_PAAMAYIM_NEKUDOTAYIM?
  167. What is the cause of this warning: ‘Warning: Cannot modify header information – headers already sent’?
  168. What is wrong with this query: “SELECT * FROM table WHERE id = $_POST[ ‘id’ ]”?
  169. What is wrong with this if statement: if( !strpos( $haystack, $needle ) …?
  170. Define a constant in PHP language?
  171. How do you pass a variable by value?
  172. In PHP language, Will comparison of string “10? and integer 11 work?
  173. When will you need to use endif statement to end the conditional statement
  174. Define the ternary conditional operator in PHP language?
  175. How to find out the no. of parameters passed into function in PHP language?
  176. If the variable $b is equal to 5 and variable $c is equal to character b, what’s the value of $$a?
  177. What is the main difference b/w accessing a class method via -> and via ::?
  178. In PHP language, are objects passed by reference or by value?
  179. How do you call a constructor for a parent class in PHP language?
  180. What is the special meaning of __sleep and __wakeup in PHP language?
  181. Why the above code does not print the new line properly?
  182. Would you initialize your strings with single quotes or double quotes?
  183. What is the common difference between characters 23 and x23 in PHP language?
  184. With a heredoc syntax, do you get variable substitution inside the heredoc contents?
  185. What is the preferred way to write this if statement, and why?
  186. What is the difference between public, protected and private in a class definition?
  187. What is the difference between an interface and an abstract class?
  188. What is wrong with classes that predominantly define getters and setters, that map straight to it’s internal members, without actually having methods that execute behaviour?
  189. Why is PHP’s implementation of the use of interfaces sub-optimal?
  190. What is the current version of PHP, Apache, MySQL?
  191. What are the uses of PHP language?
  192. why we use PHP over other languages?
  193. In PHP language, what does a special set of tags <?= and ?> do?
  194. What type of file is used when submitting a file in PHP?
  195. What is the main problem arising when you assign a variable having value 0123 and it shows a different number (value)?
  196. What is the correct way to print the amount of dollars – “$a dollars” or “{$a} dollars”?
  197. What is meant by oop in PHP?
  198. What is session tracking in PHP?
  199. What is token generation in PHP?
  200. What is hash key generation in PHP?