PHP Interview Questions For Fresher

What is PHP?
PHP is a server side scripting language commonly used for web applications. PHP has many frameworks and cms for creating websites.Even a non technical person can cretae sites using its CMS.WordPress,osCommerce are the famus CMS of php.It is also an object oriented programming language like java,C-sharp etc.It is very eazy for learning What is the use of “echo” in php?
It is used to print a data in the webpage, Example: , The following code print the text in the webpage How to include a file to a php page?
We can include a file using “include() ” or “require()” function with file path as its parameter. What’s the difference between include and require?
If the file is not found by require(), it will cause a fatal error and halt the execution of the script. If the file is not found by include(), a warning will be issued, but execution will continue.
What is session and why do we use it? Session is a super global variable that preserve data across subsequent pages. Session uniquely defines each user with a session ID, so it helps making customized web application where user tracking is needed. What is cookie and why do we use it?Cookie is a small piece of information stored in client browser. It is a technique used to identify a user using the information stored in their browser (if already visited that website) . Using PHP we can both set and get COOKIE. What function do we use to find length of string, and length of array? For finding length of string we use strlen() function and for array we use count() function. How can we change the value of a constant? We cannot change the value of a constant.What is the difference between unset() and unlink() function.unset() is used to destroy a variable where as unlink() is used to destroy a file.

Leave a Reply