GTU MCA INTERVIEW
QUESTIONS & ANSWERS FOR
By TOPS Technologies
GTU MCA INTERVIEW QUESTIONS &
ANSWERS FOR PHP
More then 2000 PHP interview questions and
answers on Basic and advance PHP for both
freshers and experienced candidate of 1 to 6 year
as It covered file system, PHP email, string
functions, header functions, pear classes and
library, regular expression , array sorting, PHP date
format, CURL, PayPal Integration, Shopping cart,
PHP Memcache and php framework like zend
framework symphony, CodeIgniter cake , YII
frameworks etc means all type of PHP questions
are going to be coveredin future. Here is a small
initialization for our PHP students to prepare for
their first industrial interview.
-By TOPS Technologies.
WHAT IS THE DIFFERENCE BETWEEN
A STATIC AND DYNAMIC WEB SITE?
A static website is one that is written in HTML only.
Each page is a separate document and there is no
database that it draws on. What this means functionally
is that the only way to edit the site is to go into each
page and edit the HTML - So you would have to do it
yourself using a web page editor such as FrontPage or
Dreamweaver, or pay your web developer to make
updates for you.
A dynamic website is created by webdevelopers who
are strong in ASP.Net, PHP, JAVA and more... This
website pages contains data is retrieved from certain
database. Each time the viewer entering a page, the
contents of that page is retrieved from the database.
The administrator can change the content and images
from admin panel. This is one that changes or
customizes itself frequently and automatically.
WHAT IS THE MEANING OF OPEN
Open-Source Software (OSS) is computer
software that is available in source code form: the
source code and certain other rights normally
reserved for copyright holders are provided under a
software license that permits users to study,
change, improve and at times also to distribute the
software.Open Source Software means it is a free
software and no need to buy, we can use full
functionallities from this software with certain Terms
& Conditions. This license allows modifications and
derived works, and allows us to be distributed under
the same terms as the license of the original
WHY WAS PHP DEVELOPED, WHAT IT
IS USED FOR, AND WHERE CAN YOU
PHP developed for less script, time saving, Free Open Source
Software and runs on different platforms such as Windows,
Linux, Unix, etc. PHP compatible with almost all servers used
today such as Apache, IIS, etc.
Perl, These languages all share a common ancestor, the C
programming language. PHP has full access to the
information that the server has, and very little access to
information that the client has. In fact, it only has information
that the client tells the server and that the server passes on to
PHP. Because it is on the server, however, PHP cannot be
modified by the client. While you cannot necessarily trust the
information that the client gives to PHP, you can trust that your
PHP is doing what you told it to do. Because PHP is on the
server end, your PHP scripts can affect your server -- such as
by keeping an activity log or updating a database.
WHAT ARE THE BENEFITS OF USING
PHP AND MYSQL?
One of the main reasons that businesses choose PHP is its simplicity and
ease of use. PHP competes against a number of other web scripting solutions
such as Active Server Pages and PERL, but none of these languages are as
easy to learn as PHP. Further, some languages require a moderate amount of
programming background before a developer can get up to speed in
development. With PHP, however, even non-programmers have been able to
develop web-based solutions within a matter of days after going through the
basic tutorials on PHP. PHP commands are simply embedded into the same
web page with HTML commands, and execute on the server to deliver the
web pages to the user.
Another big advantage of PHP is its interoperability with multiple operating
systems. A company can use PHP with either Linux, Windows or Macs for
example. They can also use PHP with the popular open source Apache
server. Compare that with Microsoft’s Active Server Pages, by contrast, which
is primarily designed for Microsoft-enabled servers. Portability is becoming a
chief concern for businesses that use one or more operating systems in their
businesses. Businesses save money by using PHP to leverage their existing
I.S. resources rather than investing large sums of money to purchase
WHAT IS FULL FORM OF PHP ? WHO IS
THE FATHER OR INVENTOR OF PHP ?
Answers : 1Rasmus Lerdorf is known as the
father of PHP that started development of PHP in
for their own Personal Home Page (PHP) and they
released PHP/FI (Forms Interpreter) version 1.0
publicly on 8 June 1995 But in 1997 two Israeli
developers named Zeev Suraski and Andi
Gutmans rewrote the parser that formed the base
of PHP 3 and then changed the language's name to
the PHP: Hypertext Preprocessor.
HOW DO YOU CONNET MYSQL
DATABASE WITH PHP?
Answer : We can connect Mysql Database with
PHP using both Procedural and Object oriented
style like below
$link = mysqli_connect("localhost",
"username", "password", "dbofpcds");
$mysqli = new mysqli("localhost", "username",
and in old type of connectivity were
$link = mysql_connect("localhost", "username",
IN HOW MANY WAYS WE CAN RETRIEVE THE DATA IN THE
RESULT SET OFMYSQL USING PHP? WHAT IS THE
DIFFERENCE BETWEEN MYSQL_FETCH_OBJECT AND
We can retrieve the data in the result set of MySQL using PHP in 4
1. mysqli_fetch_row >> Get a result row as an enumerated array
2. mysqli_fetch_array >> Fetch a result row as associative and
3.mysqli_fetch_object >> Returns the current row of a result set as
4. mysqli_fetch_assoc >> Fetch a result row as an associative
mysqli_fetch_object() is similar to mysqli_fetch_array(), with one
an object is returned, instead of an array. Indirectly, that means that
we can only access the data by the field names, and not by their
offsets (numbers are illegal property names).
• How can we create a database using PHP and
• We can create MySQL database with the use of
mysql_create_db("Database Name") Questions :
9What are the differences between require and
include?Answers : 9Both include and require used to
include a file but when included file not found
Include send Warning where as Require send Fatal
• Can we use include ("xyz.PHP") two times in a PHP
Yes we can use include("xyz.php") more than one time
in any page. but it create a prob when xyz.php file
contain some funtions declaration then error will come
for already declared function in this file else not a prob
like if you want to show same content two time in page
then must incude it two time not a prob
WHAT ARE THE DIFFERENCES
BETWEEN GET AND POST METHODS ?
• There are some defference between GET and
1. GET Method have some limit like only 2Kb data
able to send for request
But in POST method unlimited data can we send
2. when we use GET method requested data show
in url but
Not in POST method so POST method is good for
send sensetive request
WHAT IS HTACCESS? WHY DO WE USE
THIS AND WHERE?
• htaccess files are configuration files of Apache
Server which provide
a way to make configuration changes on a per-
directory basis. A file,
containing one or more configuration directives, is
placed in a particular
document directory, and the directives apply to that
directory, and all
WHAT ARE THE DIFFERENCES BETWEEN
PUBLIC, PRIVATE, PROTECTED,STATIC,
TRANSIENT, FINAL AND VOLATILE ?
Public: Public declared items can be accessed everywhere.
Protected: Protected limits access to inherited and parent
classes (and to the class that defines the item).
Private: Private limits visibility only to the class that defines
Static: A static variable exists only in a local function scope,
but it does not lose its value when program execution leaves this
Final: Final keyword prevents child classes from overriding a
method by prefixing the definition with final. If the class itself is
being defined final then it cannot be extended.
transient: A transient variable is a variable that may not
volatile: a variable that might be concurrently modified by
threads should be declared volatile. Variables declared to be
will not be optimized by the compiler because their value can
WHAT ARE MAGIC METHODS?
Magic methods are the members functions that is
available to all the instance of class Magic methods
always starts with "__". Eg. __construct All magic
methods needs to be declared as public To use
magic method they should be defined within the
class or program scope Various Magic Methods
used in PHP 5 are: __construct() __destruct()
__set() __get() __call() __toString() __sleep()
__wakeup() __isset() __unset() __autoload()
FOR MORE VISIT US AT YOUR