Friday, 27 April 2012

PHP Interview question 7


16) What is meant by nl2br()?
Ans :      Inserts HTML line breaks (<BR />) before all newlines in a string.

17) What is htaccess? Why do we use this and Where?
Ans :      .htaccess files are configuration files of Apache Server which provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.       
 
18) How we get IP address of client, previous reference page etc ?
Ans :      By using $_SERVER['REMOTE_ADDR'],$_SERVER['HTTP_REFERER'] etc.

19) What are the reasons for selecting lamp (Linux, apache, MySQL, PHP) instead of combination of other software programs, servers and operating systems?
Ans :      All of those are open source resource. Security of Linux is very very more than windows. Apache is a better server that IIS both in functionality and security. MySQL is world most popular open source database. PHP is more faster that asp or any other scripting language.

20) How can we encrypt and decrypt a data present in a MySQL table using MySQL?
Ans :      AES_ENCRYPT () and AES_DECRYPT ()

No comments:

Post a Comment