New way to learn PHP

PHP interview Questions

Q:-41. In PHP 5 class, what are the three different visibility keywords of a property of the method?

Private - only the class itself may call a method or property
Public – any class may instantiate the class called the member and member function
Protected - Only the class itself or inherited classes may call a method or property.

Q:-42. What is the use of isset() function in PHP?

It is used to determine whether a given variable is set or not. That means giving variable have a value or not.

Q:-43. In how many ways we can retrieve the data from MySql database using PHP?

There are four ways to retrieve the data from database
1. Mysql_fetch_row() functiom
2. Mysql_fetch_array() functiom
3. Mysql_fetch_object() functiom
4. Mysql_fetch_assoc() functiom

Q:-44. How can we get the second of the current time using date function?


Q:-45. What is the difference between function unlink and unset?

Unlink deletes the given file from the file system while unset makes a variable undefined means delete the variable value.

Q:-46. How can we register the variable into the session?


Q:-47. How to set a page as a home in PHP based site?

Index.php is the default name of the home page in a PHP based website.

Q:-48. What is use of count() function in PHP?

Count function is used to count all the elements of an array.

Q:-49. How do you define a constant in PHP?

define("PI", "3.141592");

Q:-50. How to get the current session ID?

Session_id() returns the session id for the current session.


Each day provides its own gifts.