I am trying to assign a variable the value of 0123, but it keeps coming up with a different number, what’s the problem?

PHP Interpreter treats numbers beginning with 0 as octal.

What are the different tables present in MySQL? Which type of table is generated when we are creating a table in the following syntax: create table employee(eno int(2),ename varchar(10))?

Total 5 types of tables we can create
2. Heap
3. Merge
MyISAM is the default storage engine as of MySQL 3.23. When you fire the above create query MySQL will create a MyISAM table.

What is the functionality of the functions STRSTR() and STRISTR()?

string strstr ( string haystack, string needle ) returns part of haystack string from the first occurrence of needle to the end of haystack. This function is case-sensitive. stristr() is idential to strstr() except that it is case insensitive.

When are you supposed to use endif to end the conditional statement?

When the original if was followed by : and then the code block without braces.

How can we send mail using JavaScript?

No. There is no way to send emails directly using JavaScript.

What is the purpose of the following files having extensions: frm, myd, and myi? What these files contain?

In MySQL, the default table type is MyISAM.
Each MyISAM table is stored on disk in three files. The files have names that begin with the table name and have an extension to indicate the file type.

The ‘.frm’ file stores the table definition.
The data file has a ‘.MYD’ (MYData) extension.
The index file has a ‘.MYI’ (MYIndex) extension,

Are objects passed by value or by reference?

Everything is passed by value.


Here are three basic types of runtime errors in PHP:

1. Notices: These are trivial, non-critical errors that PHP encounters while executing a script – for example, accessing a variable that has not yet been defined. By default, such errors are not displayed to the user at all – although you can change this default behavior.

2. Warnings: These are more serious errors – for example, attempting to include() a file which does not exist. By default, these errors are displayed to the user, but they do not result in script termination.

3. Fatal errors: These are critical errors – for example, instantiating an object of a non-existent class, or calling a non-existent function. These errors cause the immediate termination of the script, and PHP’s default behavior is to display them to the user when they take place.

Internally, these variations are represented by twelve different error types

Can we use include (“abc.php”) two times in a php page “makeit.php”?


How can we destroy the session, how can we unset the variable of a session?

session_unregister() – Unregister a global variable from the current session
session_unset() – Free all session variables

Be Sociable, Share!

4 Responses to PHP Interview Questions – II

  1. I will immediately seize your rss as I can’t to find your email subscription link or e-newsletter service. Do you’ve any? Please allow me recognise in order that I may subscribe. Thanks.

  2. I just want to say I am just all new to blogs and definitely enjoyed this blog. Very likely I’m going to bookmark your blog post . You actually come with wonderful articles. Many thanks for sharing your web page.

Leave a Reply

Your email address will not be published. Required fields are marked *

73 − = 66