Priti's Technical Corner

August 18, 2010

PHP Interview Questions

Filed under: PHP — Tags: , , , , — pritisolanki @ 5:11 pm

Question 1: can we load php extension at runtime?
Answer 1: Yes,dl() helps to loads a PHP extension at runtime.

Question 2:how to list the various extensions?
Answer 2:php -m if we are using CGI or CLI version of PHP.phpinfo() also help doing the same

Question 3:Consider


get_defined_constants() function will returns this in an output?
Answer 3: No,get_defined_constants() includes those created by extensions as well as those created with the define() function.

Question 4:Is HTTP authentication with PHP is avaiable in the CGI version?.
Answer 4: No

Question 5: what is difference between array_slice() and array_splice()?.
answer 5:arrap_slice() extract a slice of the array where as array_splice() remove a portion of the array and replace it with “replacement” parameter.

Question 6:what is difference between usort() and uasort()?.
Answer 6:usort() sort an array by values using a user defined comparison function.uasort() sort an array with a user-defined comparision function and maintain index association.

Question 7:what is the difference between array_search() and in_array()?.
Answer 7:array_search() searches the array for a given value and returns the corresponding key if successful.Whereas, in_array() checks if a value exists in an array.

Question 8:ctype_print(),checks for printable characters?.
Answer 8: Yes

Question 9:can sql statements can be executed from text file?.
Answer 9: Yes.

Question 10: How to create mysql users?.
Answer10: create user ‘username’@’localhost’ IDENTIFIED BY ‘yourpassword’;


Create a free website or blog at

%d bloggers like this: