View note:PHP-interview-questions-basic



Questions of this subject!.

QuestionLikes!Dislikes!Answers!
1)What is the difference between $_FILES['userfile']['name'] and $_FILES['userfile']['tmp_name']?

003
2)How is it possible to cast types in PHP?

004
3) When is a conditional statement ended with endif?

002
4)How is the ternary conditional operator used in PHP?

004
5)What is the meaning of a final class and a final method?

004
6)How is the comparison of objects done in PHP

001
7)What is the meaning of a Persistent Cookie?

002
8)When do sessions end?

003
9)What does $_FILES means?

001
10)How to initiate a session in PHP?

103
11)How can you propagate a session id?

002
12)What does $GLOBALS mean?

002
13)What does $_SERVER mean

003
14) What is the function func_num_args() used for

003
15)If the variable $var1 is set to 10 and the $var2 is set to the character var1, what's the value of $$var2?

002
16)What does accessing a class via :: means?

003
17)In PHP, objects are they passed by value or by reference

003
18)Are Parent constructors called implicitly inside a class constructor

002
19) What's the difference between __sleep and __wakeup

002
20)What is faster?

001
21) what is the definition of a session?

004
22)How can we check the value of a given variable is a number?

003
23)How do I check if a given variable is empty?

003
24)What does the unlink() function mean?

004
25) What does the unset() function mean?

002
26) How do I escape data before storing it in the database?

001
27) How is it possible to remove escape characters from a string?

004
28) How can we automatically escape incoming data?

003
29)What does the function get_magic_quotes_gpc() means?

002
30) Is it possible to remove the HTML tags from data?

002
31)what is the static variable in function useful for?

003
32)How can we define a variable accessible in functions of a PHP script?

002
33) How is it possible to return a value from a function?

001
34)What is the most convenient hashing method to be used to hash passwords?

002
35)Which cryptographic extension provide generation and verification of digital signatures?

001
36)How is a constant defined in a PHP script?

001
37)How can you pass a variable by reference?

003
38)Will a comparison of an integer 12 and a string "13" work in PHP?

001
39)What is the function file_get_contents() useful for?

001
40)How can we connect to a MySQL database from a PHP script?

006
41) What is the function mysql_pconnect() useful for?

001
42)How be the result set of Mysql handled in PHP?

003
43)How is it possible to know the number of rows returned in the result set?

003
44)Which function gives us the number of affected entries by a query?

001
45)What is the difference between mysqli_fetch_object() and mysqli_fetch_array()?

003
46)How can we access the data sent through the URL with the GET method?

003
47)How can we access the data sent through the URL with the POST method?

003
48)How can I display text with a PHP script

002
49) How can we display information of a variable and readable by a human with PHP

002
50)What should we do to be able to export data into an Excel file?

001
51)How can PHP and HTML interact?

004
52)What type of operation is needed when passing values through a form or an URL?

003
53)How can PHP and Javascript interact

005
54)What is needed to be able to use image function?

001
55) What is the use of the function 'imagetypes()'?

003
56)What are the functions to be used to get the image's properties (size, width, and height)?

002
57)Is multiple inheritance supported in PHP

002
58)How can we display the output directly to the browser?

002
59)What is the main difference between PHP 4 and PHP 5?

004
60)What is the actually used PHP version

002
61)How do you execute a PHP script from the command line?

009
62)How to run the interactive PHP shell from the command line interface?

004
63)What do the initials of PHP stand for?

004
64)What is PHP?

002
65)Which programming language does PHP resemble?

007
66)How is it possible to parse a configuration file?

001
67)How can we determine whether a variable is set?

001
68)What is the difference between the functions strstr() and stristr()?

001
69)what is the difference between for and foreach

003
70)Is it possible to submit a form with a dedicated button?

002
71)Is it possible to protect special characters in a query string?

001
72)What are the three classes of errors that can occur in PHP?

004
73)How can we pass the variable through the navigation between the pages

002
74)What is the difference between Exception::getMessage and Exception:: getLine?

003
75)What does the expression Exception::__toString means?

001
76)What is the goto statement useful for?

002
77)How can we get the error when there is a problem to upload a file?

003
78)What does $_ENV mean?

001
79)what the difference between the 'BITWISE AND' operator and the 'LOGICAL AND' operator?

003
80)What are the two main string operators?

003
81)What does the array operator '===' means?

002
82)What is the differences between $a != $b and $a !== $b?

001
83)How can we determine whether a PHP variable is an instantiated object of a certain class?

001
84)How is the comparison of objects done in PHP?

101
85)How failures in execution are handled with include() and require() functions?

003
86)How is it possible to set an infinite execution time for PHP script?

003
87)What does the PHP error Parse error in PHP - unexpected T_variable at line x means?

001
88)What should we do to be able to export data into an Excel file?

001
89)What is the function file_get_contents() useful for?

001
90)What is the function mysql_pconnect() useful for?

001
91)Which function gives us the number of affected entries by a query?

001
92)How can we check the value of a given variable is alphanumeric?

004
93)How do I escape data before storing it in the database?

002
94)How is it possible to return a value from a function?

002
95)Which cryptographic extension provide generation and verification of digital signatures?

002
96)What is the difference between session_unregister() and session_unset()?

001
97)What does $_FILES means?

001
98)How can we change the maximum size of the files to be uploaded?

001
99)What does $_ENV mean?

001
100)What does $_COOKIE mean?

001
101)What does the scope of variables mean?

001
102)What does the array operator '===' means?

001
103)What is the differences between $a != $b and $a !== $b?

001
104)How can we determine whether a PHP variable is an instantiated object of a certain class?

002
105)What is the goto statement useful for?

001
106)What does the expression Exception::__toString means?

001
107)How is it possible to parse a configuration file?

001
108)How can we determine whether a variable is set?

001
109)What is the difference between the functions strstr() and stristr()?

001
110)Is it possible to submit a form with a dedicated button?

001
111)What is the difference between ereg_replace() and eregi_replace()?

001
112)Is it possible to protect special characters in a query string?

001
113)What is the difference between characters \034 and \x34?

001
114)How can we pass the variable through the navigation between the pages?

001
115)Is it possible to extend the execution time of a PHP script?

002
116)Is it possible to destroy a cookie?

001
117)What is the name of scripting engine in PHP?

002
118)Explain the difference between PHP4 and PHP5.

006
119)What are the popular Content Management Systems (CMS) in PHP?

002
120)What are the popular frameworks in PHP?

004
121)What are some featuers introduced in php7?

002
122)What is the difference between $message and $$message?

004
123)What are the ways to define a constant in PHP?

005
124)What are magic constants in PHP?

002
125)How many data types are there in PHP?

004
126)How to do single and multi line comment in PHP?

001
127)What are the different loops in PHP?

002
128)What is the use of count() function in PHP?

002
129)What is the use of header() function in PHP?

001
130)What does isset() function?

001
131)Explain PHP parameterized functions.

002
132)Explain PHP variable length argument function

001
133)How many types of array are there in PHP?

004
134)What is the difference between indexed and associative array?

002
135)How to get the length of string?

002
136)Explain some of the PHP string functions?

001
137)What are the ways to include file in PHP?

001
138)Explain setcookie() function in PHP?

001
139)How can you retrieve a cookie value?

002
140)What are the encryption functions in PHP?

001
141)Explain PHP split() function.

002
142)What is Cookies? How to create cookies in PHP?

001
143)What is the Importance of Parser in PHP?

001
144)How can we create a database using PHP and MySQL?

003
145)Is PHP a strongly typed language?

001
146)What are the uses of explode() and implode() functions?

001
147)Which function can be used to exit from the script after displaying the error message?

004
148)How can you increase the maximum execution time of a script in PHP?

001
149)What is meant by ‘passing the variable by value and reference' in PHP?

003
150)How can you retrieve data from the MySQL database using PHP?

001
151)What are the differences between mysqli_connect and mysqli_pconnect?

001
152)Which function is used in PHP to count the total number of rows returned by any query?

004
153)Which function you can use in PHP to open a file for reading or writing or for both?

001
154)Which function is used in PHP to delete a file?

003
155)What is the use of strip_tags() method?

001
156)What is the difference between substr() and strstr()?

001
157)How can you declare a constant variable in PHP?

001
158)Which function is used in PHP to search a particular value in an array?

001
159)Is PHP a strongly typed language?

001
160)What are the uses of explode() and implode() functions?

002
161)Explain type casting and type juggling.

002
162)What are the differences between mysqli_connect and mysqli_pconnect?

001
163)What is the use of imagetypes() method?

002
164)Which function you can use in PHP to open a file for reading or writing or for both?

001
165)What is the use of strip_tags() method?

001
166)How can you send HTTP header to the client in PHP?

002
167)What is the difference between substr() and strstr()?

001
168)How can you upload a file using PHP?

002
169)How can you declare a constant variable in PHP?

001
170)What is the use of $_REQUEST variable?

001
171)What is PEAR?

001
172)Does PHP support multiple inheritances?

001
173)What is the use of mysqli_real_escape_string() function?

002
174)Which functions are used to remove whitespaces from the string?

001
175)What is a persistence cookie?

001
176)How can a cross-site scripting attack be prevented by PHP?

001
177)Which PHP global variable is used for uploading a file?

001
178)What is meant by public, private, protected, static and final scopes?

002
179)How can image properties be retrieved in PHP?

002
180)What is the difference between abstract class and interface?

002
181)What is garbage collection?

002
182)Which library is used in PHP to do various types of Image work?

001
183)What is URL rewriting?

002
184)What is PDO?

001
185)What are the common uses of PHP?

004
186)What is the difference between static and dynamic websites?

008
187)What is the meaning of ‘escaping to PHP’?

003
188)What are the characteristics of PHP variables?

003
189)What are the different types of PHP variables?

003
190)What are the rules for naming a PHP variable?

004
191)What are the rules to determine the “truth” of any value which is not already of the Boolean type?

001
192)What is NULL?

002
193)What is the purpose of constant() function?

001
194)What are the differences between PHP constants and variables?

005
195)Name some of the constants in PHP and their purpose.

001
196)What is the purpose of break and continue statement?

002
197)What are the two most common ways to start and finish a PHP block of code?

006
198)How can you compare objects in PHP?

002
199)What are constructor and destructor in PHP?

002
200)Explain the syntax for ‘foreach’ loop with example.

001
201)What is needed to be able to use image function?

002
202)What should we do to be able to export data into an Excel file?

001
203)What is the function file_get_contents() useful for?

001
204)Basic interview questions - PHP

002
205)Which function gives us the number of affected entries by a query?

001
206)What is the difference between mysqli_fetch_object() and mysqli_fetch_array()?

001
207)How do I check if a given variable is empty?

002
208)what is PHP ? (interview)

002
209)What is the basic Basic PHP Syntax?

001
210)What is HIDS? Bug Bounty Questions

001
211)Do you have any experience with LAMP? - PHP interview based questions

001
212)What are PHP sessions and how do they work?PHP INTERVIEW QUESTIONS

002
213)What are some of your favorite PHP design patterns?-Php interview questions

001
214)What is “Vulnerability”? Bug Bounty Questions

001
215)What is Var_dump? interview

001
216)What is a lambda function in PHP? interview questions

001
217)What is the use of post in PHP? interview questions

001
218)Multiple returns from a function- PHP interview question?

001
219)When should I use self over $this?- PHP interview

001
220)What is MVC? php interview

001