PHp Interview Questions ???

beingchinmay

New member
PHP interview Question Part-1
1) What is the difference between "echo" and "print" in PHP?
Print is not a constructor whereas echo is a constructor.
Print can take argument whereas with echo it is doesn’t support to take arguments.

2) Which will execute faster POST or GET? Explain
POST is much secured when compared to the GET method. Since it as secured method it require to pass more test then the normal GET method.

3) what are the new features that are added in PHP5?
1) PHP5 introduces SPL that provide a range of classes and
interface.
2) Contains access modifier.
3) It offers built in interface in addition to built in class.
4) It support OOPS concept.

4) What is the purpose of ob_start() ?
OB_start() turn on the output buffer. While the buffer is on, no output is sent rather it is stored in the internal buffer. Inorder to get content from output Ob_get_content function can be used.

5) How to call C function within PHP?
Not all C function can be called to PHP. Function such as fputs() fgetc() fwrite() exit() printf().

6) what is the use of header function in PHP?
The main purpose of the header function is that it redirect to the file that contains the information. More then this sometime header file are also responsible for authentication.

7 ) What is difference between require_once(), require(), include().
Because above three function usually use to call a file in another file.
require() produces a FATAL ERROR, if the file you want to include is not found.
include() just send a warining msg.

8) While in case of download, How will you make a percentage bar showing current status of total 100%?
Following procedure help to show the processing bar while download
Percentage can be displayed using image
Changing the width will help to change depending on the process completed.

9) Where does the session stored, either client side or server side?
PHP Session is used to maintain client's previous state and the session is stored on the server side.

10) Can you submit a form without using submit button ? If Yes, How?
If you don't want to use the Submit button to submit a form, you can use normal hyper links to submit a form. But you need to use some JavaScript code in the URL of the link.
 
Back
Top