Qsn 1.How do you define a constant?
Ans.Using define() directive, like define ("MYCONSTANT",150)
Qsn.2How send email using php?
Ans.To send email using PHP, you use the mail() function.This mail() function accepts 5 parameters as follows (the last 2 are optional). You need webserver, you can't send email from localhost. eg : mail($to,$subject,$message,$headers);
Qsn.3How to find current date and time?
Ans.The date() function provides you with a means of retrieving the current date and time, applying the format integer parameters indicated in your script to the timestamp provided or the current local time if no timestamp is given. In simplified terms, passing a time parameter is optional - if you don't, the current timestamp will be used.
Qsn.3Difference between mysql_connect and mysql_pconnect?
Ans.There is a good page in the php manual on the subject, in short mysql_pconnect() makes a persistent connection to the database which means a SQL link that do not close when the execution of your script ends. mysql_connect()provides only for the databasenewconnection while using mysql_pconnect , the function would first try to find a (persistent) link that's already open with the same host, username and password. If one is found, an identifier for it will be returned instead of opening a new connection... the connection to the SQL server will not be closed when the execution of the script ends. Instead, the link will remain open for future use.
Qsn.4What is the use of "ksort" in php?
Ans.It is used for sort an array by key in reverse order.