You are on page 1of 16

9/11/2013

TOPS Technologies:http://www.topsint.com/php-training-course.html

9/11/2013 TOPS Technologies:http://www.tops-int.com/phptraining-course.html

GTU MCA INTERVIEW QUESTIONS & ANSWERS FOR PHP


2

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

GTU MCA INTERVIEW QUESTIONS & ANSWERS FOR PHP


9/11/2013

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.

TOPS Technologies:http://www.topsint.com/php-training-course.html

WHAT IS THE DIFFERENCE BETWEEN A STATIC AND DYNAMIC WEB SITE?


9/11/2013

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.

TOPS Technologies:http://www.topsint.com/php-training-course.html

WHAT IS THE MEANING OF OPEN SOURCE SOFTWARE?


9/11/2013

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.

TOPS Technologies:http://www.topsint.com/php-training-course.html

WHY WAS PHP DEVELOPED, WHAT IT IS USED FOR, AND WHERE CAN YOU GET IT?
9/11/2013

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.

TOPS Technologies:http://www.topsint.com/php-training-course.html

WHAT ARE THE BENEFITS OF USING PHP AND MYSQL?


9/11/2013

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

TOPS Technologies:http://www.topsint.com/php-training-course.html

WHAT IS FULL FORM OF PHP ? WHO IS THE FATHER OR INVENTOR OF PHP ?


9/11/2013

Answers : 1Rasmus Lerdorf is known as the father of PHP that started development of PHP in 1994 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.

TOPS Technologies:http://www.topsint.com/php-training-course.html

HOW DO YOU CONNET MYSQL DATABASE WITH PHP?


9/11/2013

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);

TOPS Technologies:http://www.topsint.com/php-training-course.html

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 ?
9/11/2013

We can retrieve the data in the result set of MySQL using PHP in 4 Ways 1. 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 array mysqli_fetch_object() is similar to mysqli_fetch_array(), with one difference 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).

10

TOPS Technologies:http://www.topsint.com/php-training-course.html

How can we create a database using PHP and MySQL? 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 Error .

9/11/2013 TOPS Technologies:http://www.topsint.com/php-training-course.html

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

11

WHAT ARE THE DIFFERENCES BETWEEN GET AND POST METHODS ?


9/11/2013

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

12

TOPS Technologies:http://www.topsint.com/php-training-course.html

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


9/11/2013

htaccess files are configuration files of Apache Server which provide a way to make configuration changes on a perdirectory 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 subdirectories thereof.

13

TOPS Technologies:http://www.topsint.com/php-training-course.html

WHAT ARE THE DIFFERENCES BETWEEN PUBLIC, PRIVATE, PROTECTED,STATIC, TRANSIENT, FINAL AND VOLATILE ?
9/11/2013

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 the 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 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 be serialized. volatile: a variable that might be concurrently modified by multiple threads should be declared volatile. Variables declared to be volatile will not be optimized by the compiler because their value can change at any time.

14

TOPS Technologies:http://www.topsint.com/php-training-course.html

WHAT ARE MAGIC METHODS?


9/11/2013

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

15

TOPS Technologies:http://www.topsint.com/php-training-course.html

FOR MORE VISIT US AT YOUR NEAREST CENTER.


9/11/2013

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

16

TOPS Technologies:http://www.topsint.com/php-training-course.html

You might also like