Sunteți pe pagina 1din 4

http://jobseekersindia.blogspot.com Facebook.

com/J obseekersI ndia


PHP Interview Questions & Answers



If you know PHP, you wont find it hard to find a job even in tough conditions. Its a
skill thats in high demand. So, we thought wed share some PHP interview questions
and answers with you to ace the interview.

PHP Interview Questions and Answers
Q1: What is PHP?
PHP stands for PHP Hypertext Processor. Its a server side scripting language
generally used for making web based applications and dynamic websites. In 1995,
Rasmus Lerdorf created PHP and it was one of the first scripting languages that could
be embedded inside plain HTML.

Q2: Can you tell me the difference between include and require functions?
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.


http://jobseekersindia.blogspot.com Facebook.com/J obseekersI ndia
Q3: What is a CAPTCHA and when do you use it?
CAPTCHA is the short form of Completely Automated Public Turing Test. Its a step
taken to ensure that a feature is not abused in a way its 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.

Q4: What is the difference between GET and POST functions?
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.

Q5: Is it possible to know details about the browser being used to view a PHP
website?
Yes. We can use the get_browser() function to get the details of the browser a user is
using. This information is usually found inside the browscap.ini file.

Q6: Is it possible to create a database using PHP and MySQL?
Yes. We can create a database using the function mysql_create_db(<Insert database
name here>).

Q7: How many times is it possible to use an include function in a PHP page?
We can use include function multiple times in any dynamically generated PHP page.
However, its not considered a good practice to have multiple include functions on the
same page.

http://jobseekersindia.blogspot.com Facebook.com/J obseekersI ndia

Q8: Can you tell me whether objects are passed by value or by reference?
In PHP, everything is usually passed by value and not by reference.

Q9: What is an efficient way to combine two variables in PHP?
There are two different ways to combine variables in PHP. Lets take an example.
$var1 = Hello ;
$var2 = World;
We can combine it using the two codes below
$var 3 = $var1.$var2; and
$var3 = $var1$var2;
Its usually seen that, for large datasets, the first method outperforms the second one.

Q10: What is the current version of PHP and MYSQL?
The current versions are
PHP 5.4.1 (As of this writing. Make sure you know the current version when
you go in for your interview)
MySQL- 5.5.23








http://jobseekersindia.blogspot.com Facebook.com/J obseekersI ndia

Additional Tips to Ace PHP Interviews
In this section, well give you some additional interview tips to land a PHP job.

1. Be current with PHP, MySQL versions, upcoming releases, whats
happening in the community and so on
2. Tailor your resume to match the fact that you are extremely passionate
and proficient in this language
3. Research the company before going in for the interview. Which version
of PHP are they using? What kind of projects have they worked on?
What framework are they using?

Good luck!

S-ar putea să vă placă și