1. What is PHP ?
Ans: PHP hypertext preprocessor is a programming language that allows web developers to create dynamic content that interacts with databases.
2. What is the basic use of the PHP ?
Ans: It is basically used for developing web based software applications.
3. PHP is a server side scripting language that is embedded in ___________.
4. PHP syntax is _____
5. PHP can _____ data.
6. What are the five basic characteristics of PHP ?
7. If you want to develop php web pages then what are the three components must be installed on your system ?
- Web server
- PHP parser
8. What is the php.ini ?
Ans: The PHP configuration file, php.ini is the final and most immediate way to affect PHP’s functionality.
9. What are the two commenting formats in PHP ?
- Single-line comments
- Multi-lines comments
10. PHP is a case sensitive language True or False
11. What is whitespace ?
Ans: Whitespace is the stuff you type that is typically invisible on the screen, including spaces, tabs and carriage returns.
12. PHP is whitespace insensitive True or False
13. How to run the php script on the command prompt ?
Ans: Command: php test.php
14. All variables in PHP are denoted with a _________
15. PHP are perl-like True or False
16. What are the different data types exist in PHP ?
Ans: There are eight data types in PHP :
17. What is resources ?
Ans: Resources are special variables that hold references to resources external to php. Example: database connections
18. How many scopes types exist in php ?
- Local variables
- Function parameters
- Global variables
- Static variables
19. A constant value cannot change during the execution of the script. True or False
20. A constant is case-senitive True or False
21. What are the five magic php constants ?
22. What are the five type of operators support by php ?
- Arithmetic Operators
- Comparison Operators
- Logical (or Relational ) Operators
- Assignment Operators
- Conditional (or ternary ) Operators
23. What are the four loop types supports by php ?
- for loop
- while loop
24. What is the difference between continue statement and break statement ?
Ans: Continue : is used to halt the current iteration of a loop but it does not terminate the loop.
Break : is used to terminate the execution of a loop prematurely.
25. What are the three different kind of arrays ?
- Numeric array
- Associative array
- Multidimensional array
26. What is array ?
Ans: An array is a data structure that stores one or more similar type of values in a single value.
27. To concatenate two string variables together, use the _____ operator.
28. The __________ function is used to find the length of a string.
29. The __________ function is used to search for a string or character within a string.
30. What is the name of environment variables set by php to identifies the user’s browser and operating system ?
31. The PHP __________ is used to generate a random number.
Ans: rand() function
32. The PHP ____________ function supplies raw http headers to the browser and can be used to redirect it to another location.
33. What are the two ways that browser client can send information to the web server ?
- The GET method
- The POST method
34. How GET method and POST method send the information ?
Ans: GET method : sends the encoded user information appended to the page request. POST method: transfers information via http headers.
35. The PHP ____________ variable can be used to get the result from data sent with both the GET andPOST methods.
36. What are the two php functions which can be used to included one PHP file into another PHP file ?
Ans: 1. The include () function 2. The require () function
37. What are the four basic steps to read a file in php ?
- Open a file using fopen() function
- Get the file length using filesize() function
- Read the file’s content using fread() function
- Close the file with fclose() function
38. A new file can be written or text can be appended to an existing file using the PHP ________
Ans: fwrite () function
39. What is a function ?
Ans: A function is a piece of code which takes one more input in the form of parameter and does some processing and returns a value.
40. ___________ keyword is used to return a value from a function
41. What is cookies ?
Ans: cookies are text files stored on the client computer and they are kept of use tracking purpose.
42. PHP provided __________ function to set a cookie.
43. __________ variables are used to access the cookies.
Ans: $_COOKIE or $HTTP_COOKIE_VARS
44. _________ function to check if a cookie is set or not.
45. What is session ?
Ans: A session creates a file in a temporary directory on the server where registered session variables and their values are stored.
46. The location of the temporary file is determined by a setting in the php.ini file called ___________.
47. A php session is easily started by making a call to the ____________ function.
48. A php session can be destroyed by _________________ function.
49. PHP use ______________ function to send an email.
50. What are the three mandatory arguments required to send an email ?
a. receipient’s email address
b. subject of the message
c. actual message.
51. Information in the phpinfo.php page describes the temporary directory that is used for file uploads as _______________
52. In phpinfo.php page describe the maximum permitted size of files that can be uploaded is stated as __________.
53. ____________ contains a reference to every variable which is currently available within the global scope of the script.
54. _____________ is an array containing information such as headers, paths and script locations.
55. ___________ is an associative array of variables passed to the current script via the HTTP GET method.
56. ____________ is an associative array of variables passed to the current script via the HTTP POST method.
57. ___________ is an associative array of items uploaded to the current script via the http POST method.
58. _____________ is a variable containing the text of the last error message generated by php.
59. What are the two types of regular expression function exist in php ?
- POSIX regular expression
- PERL style regular expression
60. ___________ are used to find a range of characters.
Ans: Brackets ()
61. In PHP , how many types of functions exist for searching strings using POSIX-style regular expressions.
Ans: There are seven functions exist for searching strings using POSIX-style regular expressions.
62. In PHP, how many types of functions exist for searching strings using perl-compatible regular expressions.
Ans: There are six functions exist for searching strings using perl-compatible regular expressions.
63. ________________ is the process of catching errors raised by your program and then taking appropriate action.
Ans: Error handling
64. In PHP, how to send errors to the web server error log ?
Ans: set log_errors to On
65. What is the function name which gives you all the information that you need about the current date and time ?
Ans: time() function
66. The __________ function returns a formatted string representing a date.
67. ___________ module turns an XML document into an object that provides structured access to the xml.
68. PHP provides a special function called _________________ to define a constructor.
69. We can release all the resources with-in a destructor using ____________.
70. PHP 5 introduces the __________ keyword which prevent child classes from overriding a method by prefixing the definition with final.
71.What are the four things are similar between c and PHP ?
- Control Structures
- Function names
72. What are the two types of validation exist in PHP ?
Ans: 1. Client-side validation 2. Server-side validation
73. ____________ is used to provide the authentication for our web pages.
Ans: php login script
74. ___________ will erase the session data
75. __________ is having information about php script and HTML script to do login.
76. ____________ is having information about how to logout from login session.
Ans: logout page
77. __________ will verify the session.
78. ______________ contained array of course names and it returns the value to web browser.
79. The _____________ provides the suggestions when you enter data into the field.
Ans: auto complete search box
80. _________ is used to call the data from xml file and send the result to web browsers.
81. ____________ contained auto complete data and accessed by livesearch.php based on title field and url field.
82. _____________ has contained syntax about how to get access to rss feeds and return rss feeds to web pages.
83. A HTML Dom parser written in _____________ versions.
84. What is framework ?
Ans: It is collection of software or program that trigger off easy coding and implementing the code.
85. _________ works based on model view control and having innovative plugins.
Ans: Fuel PHP
86. _____________ is a great source to build up simple and great web application in an easy way.
Ans: Cake PHP
87. ____________ is very helpful to make Restful web services and it is under MIT licence.
88. ____________ is a special type that only has one value
89. ____________ containing one or more arrays and values are accessed using multiple indices.
Ans: Multidimensional arrays
90. The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. This process is known as ________.
Ans: escaping to php
91. ______________ checks the DNS record of corresponding the host or ip address.
Ans: checkdnsrr function
92. _____________ closing the connection of system logger.
Ans: closelog function
93. ____________ is used to open internet or unix domain socket connections.
Ans: fsockopen function
94. _____________ returns the error code from the last connection.
Ans: gethostbyaddr function
95. ___________ is used to get the host name
Ans: gethostname function
96. ____________ is used to get the MX records to host.
Ans: getmxrr function
97. __________ is used to get protocol number which has associated with protocol name.
Ans: getprotobyname function
98. ____________ is used to send the row of http headers.
Ans: header function
99. _________ used to convert internet package to human readable format.
Ans: inet_ntop function
100. __________ is used to open internet or unix domain socket.
Ans: pfsockopen function