Friday, November 5, 2010

PHP Interview Questions

1.What are the differences between require and include, include_once?
2.What is the difference between $message and $$message
3.What is the difference between echo and Print?
4. $i = 0123; echo $i; What is the output?
5.How to differentiate isset and empty?
6.What are magic quotes in PHP?
7.How to execute a PHP script using command line?
8.What is the difference between urlencode and urldecode?
9.What is the difference between unlink and unset?
10.How are the different ways to store values in session?
11.What are the ways we can destroy a session variable?
12.What Is a Persistent Cookie?
13.How do you maintain session in a load balancing system?
14.How many ways can we get the value of current session id?
15.How can we destroy the session, how can we unset the variable of a session?
16.How can we destroy the cookie?
17.How many ways we can pass the variable through the navigation between the pages?
18.What is meant by nl2br()?
19.Why is LAMP popular?
20.How can we encrypt password using PHP?
21.What are the differences between public, private, protected access modifiers?
22.What are the different types of errors in PHP?
23.What is the functionality of the function strstr and stristr?
24.What is the use of the function htmlentities()?
25.How can we convert the time zones using PHP?
26.How can we get the properties (size, type, width, height) of an image using PHP image functions?
27.How can we get the browser properties using PHP?
28.What is the maximum size of a file that can be uploaded using PHP and how can we change this?
29.How can we increase the execution time of a PHP script?
30.What are the differences between GET and POST methods in form Submission?
31.What is the use of header() function in php
32.How to upload files using PHP?
33.How will you create a bi-lingual site (multiple languages) in PHP?
34.In what are the ways you can encrypt the password?
35.How can we know the number of days between two given dates using PHP?
36.How to convert a timezone from one to another?
37.How to get seconds from current date using date function
38.What is the difference between ereg_replace and eregi_replace?
39.Write a regular expression to get the value xxx from the string ''
40.What is the difference between ereg_replace() and eregi_replace()?
41.How to get the URL domain name in PHP?
42.What are the different functions in sorting an array?
43.How can we know the count/number of elements of an array?
44.How can we create a database using PHP and mysql?
45.What are the different ways we can retrive the mysql results using php ? Explain each
46.What is the difference between mysql_fetch_object and mysql_fetch_array?
47.In how many ways we can retrieve the date in the result set of mysql using PHP?
48.Explain the difference between mysql and mysqli interfaces in PHP?
49.What is difference between mysql_fetch_array(), mysql_fetch_row() and mysql_fetch_object()?
50.What is differenc between mysql_connect and mysql_pconnect?
51.What is the PHP predefined variable that tells the What types of images that PHP supports?
52.How can I make a script that can be bilanguage (supports English, Spanish, French)?
53.What are the difference between abstract class and interface?
54.Is it possible to serialize private properties?
55.What is $GLOBALS['GLOBALS']?
56.How can maintain a hit counter in PHP?
57.How I can get IP address of the user viewing the webpage?
58.How to check that user is logged in or not?
59.List out the predefined classes in PHP
60.Is Inheritance supported in PHP?
61.What are the new features in PHP6?
62.How to send email using PHP?
63.What is PEAR?
64.What is PECL?
65.What are the different ways to parse XML in PHP?