gtu mca php interview questions and answers for freshers

16
9 / 1 1 / 2 0 1 3 1 T O P S T e c h n o l o g i e s : h t t p : / / w w w . t o p s - i n t . c o m / p h p - t r a i n i n g - c o u r s e . h t m l

Upload: neil-modi

Post on 10-Dec-2014

1.954 views

Category:

Career


7 download

DESCRIPTION

MCA GTU Student can refer PHP Interview Questions and Answers, This Php Q & A will helpful for Live GTU Projects as well as for Interview.. Visit us at TOPS Technologies http://www.tops-int.com

TRANSCRIPT

Page 1: GTU MCA PHP  Interview Questions And Answers for freshers

9/1

1/2

01

3

1

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 2: GTU MCA PHP  Interview Questions And Answers for freshers

GTU MCA INTERVIEW QUESTIONS & ANSWERS FOR PHPBy TOPS Technologies

http://www.tops-int.com/php-training-course.html

9/1

1/2

01

3

2

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-in

t.com

/ph

p-

train

ing

-cou

rse.h

tml

Page 3: GTU MCA PHP  Interview Questions And Answers for freshers

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.

9/1

1/2

01

3

3

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 4: GTU MCA PHP  Interview Questions And Answers for freshers

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.

9/1

1/2

01

3

4

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 5: GTU MCA PHP  Interview Questions And Answers for freshers

WHAT IS THE MEANING OF OPEN SOURCE SOFTWARE?

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 software.

9/1

1/2

01

3

5

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 6: GTU MCA PHP  Interview Questions And Answers for freshers

WHY WAS PHP DEVELOPED, WHAT IT IS USED FOR, AND WHERE CAN YOU GET IT? 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.

The PHP scripting language resembles JavaScript, Java, and 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.

9/1

1/2

01

3

6

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 7: GTU MCA PHP  Interview Questions And Answers for freshers

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 proprietary products.

9/1

1/2

01

3

7

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 8: GTU MCA PHP  Interview Questions And Answers for freshers

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 1994for 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.  

9/1

1/2

01

3

8

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 9: GTU MCA PHP  Interview Questions And Answers for freshers

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", "password", "dbname");and in old type of connectivity were $link = mysql_connect("localhost", "username", "password");mysql_select_db("database",$link);

9/1

1/2

01

3

9

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 10: GTU MCA PHP  Interview Questions And Answers for freshers

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 MYSQL_FETCH_ARRAY ?

We can retrieve the data in the result set of MySQL using PHP in 4 Ways1. mysqli_fetch_row >> Get a result row as an enumerated array 2. mysqli_fetch_array >> Fetch a result row as associative and numeric array 3.mysqli_fetch_object >> Returns the current row of a result set as an object 4. mysqli_fetch_assoc >> Fetch a result row as an associative arraymysqli_fetch_object() is similar to mysqli_fetch_array(), with one difference -an object is returned, instead of an array. Indirectly, that means thatwe can only access the data by the field names, and not by theiroffsets (numbers are illegal property names).

9/1

1/2

01

3

10

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 11: GTU MCA PHP  Interview Questions And Answers for freshers

• How can we create a database using PHP and MySQL?

• We can create MySQL database with the use ofmysql_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 Error .

•  Can we use include ("xyz.PHP") two times in a PHP page "index.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

9/1

1/2

01

3

11

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 12: GTU MCA PHP  Interview Questions And Answers for freshers

WHAT ARE THE DIFFERENCES BETWEEN GET AND POST METHODS ?

• There are some defference between GET and POST method 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

9/1

1/2

01

3

12

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 13: GTU MCA PHP  Interview Questions And Answers for freshers

WHAT IS HTACCESS? WHY DO WE USE THIS AND WHERE?

• htaccess files are configuration files of Apache Server which providea way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particulardocument directory, and the directives apply to that directory, and all subdirectories thereof.

9/1

1/2

01

3

13

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 14: GTU MCA PHP  Interview Questions And Answers for freshers

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 parentclasses (and to the class that defines the item).Private: Private limits visibility only to the class that definesthe item.Static: A static variable exists only in a local function scope,but it does not lose its value when program execution leaves this scope.Final: Final keyword prevents child classes from overriding amethod by prefixing the definition with final. If the class itself isbeing defined final then it cannot be extended.transient: A transient variable is a variable that may notbe serialized. volatile: a variable that might be concurrently modified by multiplethreads should be declared volatile. Variables declared to be volatilewill not be optimized by the compiler because their value can change atany time.

9/1

1/2

01

3

14

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 15: GTU MCA PHP  Interview Questions And Answers for freshers

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() __clone()

9/1

1/2

01

3

15

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml

Page 16: GTU MCA PHP  Interview Questions And Answers for freshers

FOR MORE VISIT US AT YOUR NEAREST CENTER.

• http://www.tops-int.com• http://www.tops-int.com/php-training-course.html

9/1

1/2

01

3

16

TO

PS

Te

chn

olo

gie

s:http

://ww

w.to

ps-

int.co

m/p

hp

-train

ing

-cou

rse.h

tml