# PHP Questions

Q:

How many types of Inheritances used in php and how we achieve it?

As far PHP concern it only support single Inheritance in scripting. we can also use interface to achieve multiple inheritance.

Subject: PHP - Technology

988
Q:

What is a .htacces file

.htaccess is a configuration file running on Apache server.These .htaccess file used to change the functionality and features of apache web  server .

e.g   .htaccess file used for url rewrite .

.htaccess file used to make the site password protected.

.htaccess file can restrict  some ip addresses ,so that on restricted ip adresses  site will not open.

Subject: PHP - Technology

978
Q:

What are encryption functions in PHP?

CRYPT(), MD5()

Subject: PHP - Technology

964
Q:

What is the difference between the functions unlink and unset?

unlink()-deletes the given file from the file system.
unset() -makes a variable undefined.

Subject: PHP - Technology

956
Q:

What is the use of header() function in php?

The header() function sends a raw HTTP header to a client. We can use header() function for redirection of pages. It is important to notice that  header()  must be called before any actual output is seen..

Subject: PHP - Technology

950
Q:

variable - name of the cookie variable
value     - value of the cookie variable
time       - expiry time

Example:
<?php
setcookie('Test',$i,time()+3600); ?> Test - cookie variable name$i - value of the variable 'Test'
time()+3600 - denotes that the cookie will expire after an one hour

Subject: PHP - Technology

916
Q:

How can we know the number of days between two given dates using php?

<?php
$tomorrow = mktime(0, 0, 0, date("m") , date("d")+1, date("Y"));$lastmonth = mktime(0, 0, 0, date("m")-1, date("d"), date("Y"));
echo ($tomorrow-$lastmonth)/86400;
?>

Subject: PHP - Technology

895