You are on page 1of 5

PHP 1. Difference between mysql_fetch_array and mysql_fetch_row?

A: mysql_fetch_array returns enumarated array as well as associative array Mysql_fetch_row returns enumerated array only. 2. Difference between explode and split? Explode: splitting a string into substrings by a string. Split: Spitting a string into substrings by a string and also by regular expressions.

3. What is .htaccess file?

.htaccess is used for multiple purposes. For url rewriting, setting the php.ini settings like max_execution_time, max_upload_size(file upload), memory_limit etc.

4. Default max_execution_time: 30 sec Max_upload_size: 2M Max_post_data: 8M.

5. What are the changes you can do in apache configuration httpd.conf file? For url rewriting enabling the LoadModule rewrite_module Changing the default port 80 to other port numbers by Changing Listen 80 6. How can you change the default settings of php.ini file when you dont have the access to php.ini file?

By using iniset() function and by .htaccess file

7. File upload in PHP?

Input type should be file and form encryption type should be mutipart form data. After checking the file type, file extension, moving the file to destination by move_upload_file function.

8. What are the global arrays in PHP? $_POST, $_GET, $_REQUEST, $_ENV,$_FILE.

9. What are the Changes from PHP4 to PHP5? In PHP5 Some of the oops concepts are added. Those are Access modifiers public/private/Protected.(Visibitity)

Unified constructors( __construct()) and unified destructors(__destructor()) Interfaces instanceof operator final methods, final Classes(finality) abstract Classes Auto loading Static Methods and Properties Object Cloning and Type Hinting, Magic Methods. Exception Handling What are the error types in PHP? Warnings, Notices, Syntax errors and Fatal Errors What are the difference between abstract classes and interfaces? Any method in a class defined as abstract, then it is a abstract class. The method which is abstract it only declared, but it should be defined in extending class.

In interfaces are the methods are abstract means every method is declared not defined. Those are defined in extending classes. We can place shared data in the abstract classes, but we can not in interfaces. Difference between mysql_connect and mysql_pconnect? What is object cloning? Creating a copy of an Object with same properties and methods. Static Methods : we can access these methods without creating an instance of a class. We can access with SCOPE RESOLUTION OPERATOR ( :: ). Auto Loading? We are writing classes, some classes are necessary to include, sometimes we will forgot to include, but autoload will include all necessary classes into that file. What is Overloading and overriding? Overloading: having the methods with the same name in parent class and child class. Overriding is different for java in PHP, Over riding means creating methods automatically by using Magic Methods. What are the Magic Methods? _sleep, _wakeup, _construct, _destruct, _isset, _get, _unset etc. What is inheritance? Types? inheriting all the properties and methods of a parent class. Types: single inheriting, multi level, multiple (by interfaces). Xml parsing by simple_xml_load() function. In php Methods Values will pass object by reference not by object by value. Difference between single code and double code? In Single code: some of the special characters will effect like new line, new tab like \n \t \r etc. but not in double codes How can you install php extensions in LAMP? First, I have to download those packages by apt get in ubantu. Configuring that package by phpconfigure

Adding the extension in php.ini file like Security things in PHP Code? How can you optimize your code? First checking for un wanted script (methods, classes), javascripts etc. Avoiding downloads Strstr and stristr Strstr for get the substring after the given string. It is Case sensitive. Stristr is case insensitive. Difference between include and include_once, require_require_once? Sessions Vs Cookies? What is Curl in PHP? What is PDO? What is Pear? MYSQL

What is default engine in PHP? InnodB Types of storage engines in PHP? MyISAM,InnoDB,ISAM,Merge,Heap Difference between InnoDB and MyISAM? Transactions: MyISAM will not support for transactions, InnoDB will support Locking: when updating the row in a table, In MyISAM hole table will locked, but in InnoDB that row only locked. Foreign Key: MyISAM will not support, InnoDB will support. Primary key Vs Unique Key? Primary Key will not allow null value but Unique key will allow null value.

Joins in Mysql? Inner Join and Outer Joins and explain Transactions in mysql? By rollback and commit. Stored Procedures? What is indexing and how you will create? Indexing is a one of the query optimizing technique. When writing a query, condition fields in where clause, on that conditioning fields we have to create index, indexes will create temp storage to get the values faster. Optimization Techniques? Indexing, avoiding unnecessary parenthesis in conditions and avoiding unnecessary conditions, optimizing group by etc. Some times de normalization is also support. Group by Vs having We can not use aggregate functions sum(),avg() etc with Group by, we can use with having. Normalization and types? AJAX Ajax ready States? 0 to 4 0 no request Connection Established with the server Received Request Processing Ready to give result.