01-03-2013, 09:42 AM
PHP Interview Questions
PHP Interview.pdf (Size: 107.79 KB / Downloads: 84)
1. What is CAPTCHA?
CAPTCHA stands for Completely Automated Public Turing Test to tell Computers and
Humans Apart. To prevent spammers from using bots to automatically fill out forms,
CAPTCHA programmers will generate an image containing distorted images of a string
of numbers and letters. Computers cannot determine what the numbers and letters are
from the image but humans have great pattern recognition abilities and will be able to
fairly accurately determine the string of numbers and letters. By entering the numbers
and letters from the image in the validation field, the application can be fairly assured
that there is a human client using it. To read more look here:
http://en.wikipediawiki/Captcha
2. What is difference between require_once(), require(), include().
Becouse above three function usely use to call a file in another file?
Difference between require() and require_once(): require() includes and evaluates a
specific file, while require_once() does that only if it has not been included before (on
the same page). So, require_once() is recommended to use when you want to include a
file where you have a lot of functions for example. This way you make sure you don't
include the file more times and you will not get the "function re-declared" error.
Difference between require() and include() is that require() produces a FATAL ERROR
if the file you want to include is not found, while include() only produces a WARNING.
There is also include_once() which is the same as include(), but the difference between
them is the same as the difference between require() and require_once().
3. If you have to work with dates in the following format: "Tuesday, February 14, 2006
@ 10:39 am", how can you convert them to another format, that is easier to use?
The strtotime function can convert a string to a timestamp. A timestamp can be
converted to date format. So it is best to store the dates as timestamp in the database,
and just output them in the format you like.