Thursday 25 September 2014

Interview Question and Answer

Q1. Who is the Father of PHP?

Ans. Rasmus Lerdorf

Q2. What is PHP stands for?

Ans. Hyper text Pre Processor

Q3. What is PHP?

Ans. The PHP is a Hypertext Pre-processor and is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications.

Q4. Which programming language does PHP resemble to?

Ans. PHP resemble to pearl and C

Q5. How can we create a database using PHP and MySQL?

Ans. We can create MySQL database with the use of
mysql_create_db ("Database Name")

Q6. Difference between include and require functions?

Ans:Both these functions differ in how they handle failures that occur. Suppose a file is not found by the include() function, then it will simply give a warning and script execution will not be interrupted. However, if a file is not found using a require() function, it will throw up a fatal warning and stop the script execution.

Q7. What is a CAPTCHA & when do you use it?

Ans: CAPTCHA is the short form of Completely Automated Public Turing Test. It‟s a step taken to ensure that a feature is not abused in a way it‟s not meant to be used. We use CAPTCHAS for general form submissions, registrations, user generated content and so on to prevent spam bots from clogging up the system or spamming.

Q8. How many times is it possible to use an include function in a PHP page?

Ans:We can use include function multiple times in any dynamically generated PHP page. However, it‟s not considered a good practice to have multiple include functions on the same page.

Q9. What is an efficient way to combine two variables in PHP?

Ans:There are two different ways to combine variables in PHP. Let‟s take an example.
  • $var1 = „Hello „;
  • $var2 = „World‟;
We can combine it using the two codes below
  • $var 3 = $var1.$var2; and
  • $var3 = “$var1$var2″;
It‟s usually seen that, for large datasets, the first method outperforms the second one.

Q10. What is the difference between GET and POST functions?

Ans:GET function is normally used when the result of using this function does not cause any visible change on the state of the world. This is normally used in cases like searching from a database where no changes are made to the system.

POST function is used when there is a visible change on the state of the world. When we use a POST function,  normally the system changes. E.g. when we add, delete or modify values from a database. A simple example is a form submission.

No comments:

Post a Comment