PHP interview questions for freshers and experienced candidates

12 January 2022

PHP interview questions for freshers and experienced candidates

PHP as a web development language offers great scope as a career. At PHP Kolkata being in the field of PHP training we have always tried to make you aware about the various aspects of a PHP career. We have covered everything from scope of PHP as a career to the salaries you can expect, like the one titled "Get to know the salary of PHP developers in India. We hope by this time you would have gained a fair idea about PHP as a whole. However we are sure that if you want to develop a high flying career in the field, you would like to start off with an ideal job. But to do so you need to crack your job interview. So in this blog we will provide certain questions you must be well prepared for.

PHP job is great but you need to have the right knowledge

As a PHP professional in Kolkata, you could expect to start off with a starting salary of about Rs 7000 per month. But if you are able to develop yourself in the field you could even draw salaries exceeding Rs 50,000 per month as well. So it is all about how good you are at your job. To do so you therefore need the right trainer in the field. What is also important that along with the theory you must also have practical knowledge in the field too. But no matter how much you know you should be well prepared for your job interview. The best way to deal with your job interview is if you are prepared with answers for those questions which are expected. The following are some of the basic questions, the answers of which you should be thorough with.

PHP job interview: the answers to questions you must be thorough with

php interview question What is PHP? Though this is the most basic, but you need to start with the basics. Often when suddenly asked there may be a tendency to fumble. So be well prepared with the answer for this.

Basic Question for all PHP Developer

  1. Tell Me About Yourself
  2. Why Choose PHP?
  3. What Is Your Greatest Weakness?
  4. What Is Your Greatest Strength?
  5. Why Should We Hire You?

Basic Question For PHP Fresher

  1. What is PHP?
  2. What is MVC?
  3. What is meant by nl2br()?
  4. What is the maximum length of a table name, a database name, or a field name in MySQL?
  5. Get size of a file using php?
  6. Function for merging two arrays?
  7. How do you define a constant?
  8. How send email using php?
  9. How to find current date and time?
  10. How to delete a file from the system
  11. PHP being an open source is there any support available to it?
  12. How php concatenation works?
  13. What is the use of super-global arrays in PHP?
  14. What is the use of $_SERVER and $_ENV?
  15. Write a statement to show the joining of multiple comparisons in PHP?
  16. Differences between GET and POST methods ?
  17. How to declare an array in php?
  18. What is use of in_array() function in php ?
  19. How to set cookies in PHP and Retrieve a Cookie Value?
  20. How to create a session? How to set a value in session ? How to Remove data from a session?
  21. what types of loops exist in php?
  22. Acronym of PHP?
  23. What is the use of header() function in PHP?
  24. What is the array in PHP?
  25. How can you submit a form without a submit button?
  26. What is the difference between the functions unlink and unset?
  27. What is the method to register a variable into a session?
  28. What are the encryption functions in PHP?
  29. Explain the importance of the function htmlentities
  30. What is MIME?
  31. How can we increase the execution time of a php script?
  32. What is Type juggle in php?
  33. What is the function file_get_contents() usefull for?
  34. How is it possible to know the number of rows returned in result set?
  35. What is the static variable in function useful for?
  36. What is the most convenient hashing method to be used to hash passwords?
  37. How is the ternary conditional operator used in PHP?
  38. What does accessing a class via :: means?
  39. Are Parent constructors called implicitly inside a class constructor?
  40. What’s the difference between __sleep and __wakeup?
  41. What is the difference between mysql_fetch_object() and mysql_fetch_array()?
  42. What does $_FILES means?
  43. How can we change the maximum size of the files to be uploaded?
  44. What does the scope of variables means?
  45. What is the differences between $a != $b and $a !== $b?
  46. What is the goto statement useful for?
  47. What is the difference between Exception::getMessage and Exception::getLine ?
  48. What is the difference between ereg_replace() and eregi_replace()?
  49. What is the default session time in php?
  50. Is it possible to use COM component in PHP?
  51. How can we get the browser properties using PHP?
  52. How to store the uploaded file to the final location?
  53. What is the difference between preg_split() and explode()?
  54. How to upload files using PHP?
  55. What is the use of explode() function ?
  56. What is the use of mysql_real_escape_string() function?
  57. How to strip whitespace (or other characters) from the beginning and end of a string ?
  58. How to redirect a page in php?
PHP Question For PHP Experience Student
php question for expert
  1. How stop the execution of a php script ?
  2. Who is the father of PHP?
  3. What does ODBC do in context with PHP?
  4. What is difference between require_once(), require(), include()?
  5. Purpose of method attribute in html form?
  6. Define Object-Oriented Methodology?
  7. What is the difference between session_unregister() and session_unset()?
  8. What does $_SERVER means?
  9. What is Constructors and Destructors?
  10. How to find the length of a string?
  11. What is the use of rand() in php?
  12. What is Joomla in PHP?
  13. What are the different types of errors in PHP?
  14. What is the difference between $besant and $$besant?
  15. How do you connect MySQL database with PHP?
  16. Difference echo() and print()?
  17. Differentiate between require and include?
  18. What is the use of count() function in PHP?
  19. What is the use of isset() in php?
  20. How to get the value of current session id?
  21. What is sql injection?
  22. Is multiple inheritance supported in PHP?
  23. What is the meaning of a final class and a final method?
  24. How comparison of objects is done in PHP5?
  25. What is the difference between session and cookie?
  26. Describe functions strstr() and stristr()?
  27. Explain the purpose of output buffering in PHP
  28. How can we know the number of days between two given dates using PHP?
  29. What is the difference between PHP and JavaScript?
  30. How we can retrieve the data in the result set of MySQL using PHP?
  31. How can you retrieve a cookie value?
  32. Explain the difference between static and dynamic websites?
  33. What is the name of scripting engine in PHP?
  34. What are the methods of form submitting in PHP?
  35. What is a session?
  36. What is needed to be able to use image function?
  37. What is the use of the function ‘imagetypes()’?
  38. What are the functions to be used to get the image’s properties (size, width and height)?
  39. How is it possible to set an infinite execution time for PHP script?
  40. What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?
  41. What is the meaning of a Persistent Cookie?
  42. When sessions ends?
These are some of the very basic questions you must be able to answer with confidence. We are sure that if your concepts about PHP are clear, you would be able to handle any question which is asked. However if you are asked to answer a question, which you do not know, it is best to admit that you do not know. It is better than to pretend you know and then not being able to answer it. Interviewers are always experienced. So it is best to be honest with them always. This is something which they surely would appreciate. Your honesty along with your knowledge levels would help you get selected. We have been in the PHP training field for more than 10 years. So not only do we provide the best training in the field, but also ensure that you get well prepared for your job interviews.