Tuesday, August 12, 2008

PHP Interview Questions and Answers

Question: Is PHP a case sensitive programming language?

Answer: PHP is a partially case sensitive programming language. We can use function names, class names in case insensitive manner.

Question: What is mean by LAMP?

Answer: LAMP means combination of Linux, Apache, MySQL and PHP.

Question: How do you get the user’s ip address in PHP?

Answer: Using the server variable: $_SERVER[’REMOTE_ADDR’]

Question: What is the difference between require and include?

Answer: When using require function to embed another file in php, it will give fatal error if the file is not exists.
When using include function to embed another file in php, it will give warning if the file is not exists.


Question: How to find the number of elements in an array?

Answer: Using count($array) or sizeof($array).

Question: How do you make one way encryption for your passwords in PHP?

Answer: Using md5 function or sha1 function

Question: How do you get ASCII value of a character?

Answer: By using ord function.

No comments: