PHP stands for Hypertext Preprocessor and it is a general-purpose programming language originally designed for web development. It is an interpreted language i.e there is no need for compilation. It’s a server-side scripting language. One of the key points is PHP is faster than other scripting languages, for examples, ASP and JSP.
The best things in using PHP are that it is extremely simple for a newcomer, but offers many advanced features for a professional programmer.
PHP Interview Questions – 120 Questions
- What is PHP?
- What do the initials of PHP stand for?
- Which programming language does PHP resemble?
- What does PEAR stand for?
- What is the actually used PHP version?
- How do you execute a PHP script from the command line?
- How to run the interactive PHP shell from the command line interface?
- What is the correct and the most two common way to start and finish a PHP block of code?
- How can we display the output directly to the browser?
- What is the main difference between PHP 4 and PHP 5?
- Is multiple inheritance supported in PHP?
- What is the meaning of a final class and a final method?
- How is the comparison of objects done in PHP?
- How can PHP and HTML interact?
- What type of operation is needed when passing values through a form or an URL?
- What is needed to be able to use the image function?
- What is the use of the function ‘imagetypes()’?
- What are the functions to be used to get the image’s properties (size, width, and height)?
- How failures in execution are handled with include() and require() functions?
- What is the main difference between require() and require_once()?
- How can I display text with a PHP script?
- How can we display information of a variable and readable by a human with PHP?
- How is it possible to set an infinite execution time for PHP script?
- What does the PHP error ‘Parse error in PHP – unexpected T_variable at line x’ means?
- What should we do to be able to export data into an Excel file?
- What is the function file_get_contents() useful for?
- How can we connect to a MySQL database from a PHP script?
- What is the function mysql_pconnect() useful for?
- How be the result set of Mysql handled in PHP?
- How is it possible to know the number of rows returned in the result set?
- Which function gives us the number of affected entries by a query?
- What is the difference between mysqli_fetch_object() and mysqli_fetch_array()?
- How can we access the data sent through the URL with the GET method?
- How can we access the data sent through the URL with the POST method?
- How can we check the value of a given variable is a number?
- How can we check the value of a given variable is alphanumeric?
- How do I check if a given variable is empty?
- What does the unlink() function mean?
- What does the unset() function mean?
- How do I escape data before storing it in the database?
- How is it possible to remove escape characters from a string?
- How can we automatically escape incoming data?
- What does the function get_magic_quotes_gpc() means?
- Is it possible to remove the HTML tags from data?
- what is the static variable in function useful for?
- How can we define a variable accessible in functions of a PHP script?
- How is it possible to return a value from a function?
- What is the most convenient hashing method to be used to hash passwords?
- Which cryptographic extension provide generation and verification of digital signatures?
- How is a constant defined in a php script?
- How can you pass a variable by reference?
- How is it possible to cast types in PHP?
- When is a conditional statement ended with endif?
- How is the ternary conditional operator used in php?
- What is the function func_num_args() used for?
- What does accessing a class via :: means?
- In PHP, objects are they passed by value or by reference?
- Are Parent constructors called implicitly inside a class constructor?
- What’s the difference between __sleep and __wakeup?
- What is faster?
- what is the definition of a session?
- How to initiate a session in PHP?
- How can you propagate a session id?
- What is the meaning of a Persistent Cookie?
- When do sessions end?
- What is the difference between session_unregister() and session_unset()?
- What does $GLOBALS mean?
- What does $_SERVER mean?
- What does $_FILES means?
- What is the difference between $_FILES[‘userfile’][‘name’] and $_FILES[‘userfile’][‘tmp_name’]?
- How can we get the error when there is a problem to upload a file?
- How can we change the maximum size of the files to be uploaded?
- What does $_ENV mean?
- What does $_COOKIE mean?
- What does the scope of variables mean?
- what the difference between the ‘BITWISE AND’ operator and the ‘LOGICAL AND’ operator?
- What are the two main string operators?
- What does the array operator ‘===’ means?
- What is the differences between $a != $b and $a !== $b?
- How can we determine whether a php variable is an instantiated object of a certain class?
- What is the goto statement useful for?
- what is the difference between Exception::getMessage and Exception:: getLine?
- What does the expression Exception::__toString means?
- How is it possible to parse a configuration file?
- How can we determine whether a variable is set?
- What is the difference between the functions strstr() and stristr()?
- what is the difference between for and foreach?
- Is it possible to submit a form with a dedicated button?
- What is the difference between ereg_replace() and eregi_replace()?
- Is it possible to protect special characters in a query string?
- What are the three classes of errors that can occur in PHP?
- How can we pass the variable through the navigation between the pages?
- Is it possible to extend the execution time of a php script?
- Is it possible to destroy a cookie?
- What is the default session time in PHP?
- Is it possible to use COM component in PHP?
- Explain whether it is possible to share a single instance of a Memcache between multiple php projects?
- Explain how you can update Memcached when you make changes to PHP?
- What’s the difference between the include() and require() functions?
- How can we get the IP address of the client?
- What’s the difference between unset() and unlink()
- What are the main error types in PHP and how do they differ?
- What is the difference between GET and POST?
- How can you enable error reporting in php?
- What are Traits?
- Can the value of a constant change during the script’s execution?
- Can you extend a Final defined class?
- What are the __construct() and __destruct() methods in a php class?
- How we can get the number of elements in an array?
- What are the 3 scope levels available in php and how would you define them?
- What are getters and setters and why are they important?
- What does MVC stand for and what does each component do?
- How does one prevent the following Warning ‘Warning: Cannot modify header information – headers already sent’ and why does it occur in the first place?
- What are SQL Injections, how do you prevent them and what are the best practices?
- Why would you use === instead of ==?
- Describe the Use of “ksort” in PHP
- What are PSRs? Choose 1 and briefly describe it.
- What PSR Standards do you follow? Why would you follow a PSR standard?
- How Is a Session Created? How Is a Value Set in Session? How Do You Remove Data From a Session?
Related Interview Questions and Answer
MongoDB MongoDB is an open source document database4 and leading NoSQL database. It's a powerful, FREE & highly scalable NoSQL database. Its very popular choice of a highly scalable database and currently being used as the backend data store of many well-known...
C Programming Language The C programming language is a popular and widely used programming language for creating computer programs. The main feature of C language includes low-level access to memory, a simple set of keywords, and clean style these features make C...
Python Interview Question Python Programming can be easy to pick up whether you're a first-time programmer or you have experienced in other languages. It is one of the most widely used programming languages. Despite being slow python is very popular,...
Why Behavioral Interview Questions Every business sets its operating rules and directives aligned with their vision, mission, purpose, and objectives. During the interview, it is the responsibility of a hiring manager to find candidates whose values, attitude, skills,...
500 Dot Net Interview Questions Interviews become unnerving at times. But, in spite of whatever one thinks about it, you still have to go through it in order to get the job to leverage your geniuses and earn the income to fulfil your life goals. Dot Net...
300 IOS Interview Questions Interviews become unnerving at times. But, in spite of whatever one thinks about it, you still have to go through it in order to get the job to leverage your geniuses and earn the income to fulfil your life goals. These 300 IOS...
Top 100 Android Interview Questions Interviews become unnerving at times. But, in spite of whatever one thinks about it, you still have to go through it in order to get the job to leverage your geniuses and earn the income to fulfil your life goals. This...
Dreaming about a career in IT? But let's be clear in our mind, to have a fantastic career in IT, the hands-on experience and expertise in Java Programming Language is the most essential requirement. Now, you must be wondering that “Why should I learn Java Programming...
Sometimes we prepare in and out about our subjects so much that we forgot to get our hands on some basic yet important behavioural questions and this is where interviewer caught us off guard. Most of us don't even know how to cope up with such catch 22 situation....
We live in a period where data is the most important resource and it's being put on a fundamental level of each basic leadership process. SQL powers the most commonly used database engines like MySQL, SQL Server, SQLite, and PostgreSQL: Source: StackOverflow Developer...