PHP Compile Test
PHP Compile Test
1. A script is a
a. Program or sequence of instructions that is interpreted or carried out by processor
directly
b. Program or sequence of instruction that is interpreted or carried out by another
program
c. Program or sequence of instruction that is interpreted or carried out by web server
only
d. None of above
4. PHP is a widely used ……………. scripting language that is especially suited for
web development and can be embedded into html
a. Open source general purpose
b. Proprietary general purpose
c. Open source special purpose
d. Proprietary special purpose
6. The most portable version of PHP tag that is compatible to embed in XML or
XHTML too is:
a. <? ?>
b. <script language=”php”> </script>
c. <% %>
d.
10. Which of the following function returns the number of characters in a string variable?
a. count($variable)
b. len($variable)
c. strcount($variable)
d. strlen($variable)
11. When you need to obtain the ASCII value of a character which of the following
function you apply in PHP?
a. chr( );
b. asc( );
c. ord( );
d. val( );
12. A variable $word is set to “HELLO WORLD”, which of the following script returns
in title case?
a. echo ucwords($word)
b. echo ucwords(strtolower($word)
c. echo ucfirst($word)
d. echo ucfirst(strtolower($word)
14. When a file is included the code it contains, behave for variable scope of the line on
which the include occurs
a. Any variable available at that line in the calling file will be available within the
called file from that point
b. Any variable available at that line in the calling file will not be available within the
called file
c. Variables are local in both called and calling files
d. None of above
15. Which of the following method sends input to a script via a URL?
a. Get
b. Post
c. Both
d. None
16. Which of the following method is suitable when you need to send larger form
submissions?
a. Get
b. Post
c. Both Get and Post
d. There is no direct way for larger form. You need to store them in a file and retrieve
17. Which of the following mode of fopen() function opens a file only for writing. If a
file with that name does not exist, attempts to create anew file. If the file exist, place the
file pointer at the end of the file after all other data.
a. W
b. W+
c. A
d. A+
9. Php supports all four different ways of delimiting. In this context identify the false
statement
a. You can use any of the delimiting style
b. You can use different delimiting styles in same page
c. You can use any delimiting style but must use a single style consistently for a page
d. Variables declared in previous blocks are remenbered on later blocks too!
11. To produce the output6 I love the summer time, Which of the ofllowing statement
should be used?
a. <? Php print ("<P> I love the summer time</p>" ;?>
b. <? Php $ season="summer time"; print"<p> I love the $ season</p>"; ?>
c. <?Php $ message="<p> I love the summer time </p>; ecdho $ message; ?>
d. All of above
13. Which of followng statement is more suitable if you want to output a blend of
static text and dynamic information stored within one or several variables?
a. echo ( )
b. print ( )
c. Print f ( )
d. None of above
15. Which of the following function can assign the output to a string variable
a. echo ( )
b. print ( )
c. print f ( )
d. s print f ( )
16. Which of the following data type is not seal or datetype supported by PHP
a. Array
b. String
c. Float
d. Boolean
17. Which of the following data type is compound datatype supported by PHP
a. Array
b. String
c. Float
d. Boolean
a. floats
b. integer
c. doubles
d. Real number
a. 4.5678
b. 4.0
c. 7e4
d. All of above
d. All of above
d. All of above
a. Integer
b. Float
c. String
d. Booleans
a. Array
b. Objects
c. Both
d. None
a. (array)
b. (int64)
d. (object)
d. None of above
a. my-function
b. size
c. –some word
d. This&that
a. $value1= $value?
d. None
a. Local variables
b. Function parameters
c. Hidden variables
d. Global variables
$somerar=15;
function ad it () {
GLOBAL $somevar;
$somerar++ ;
addit ();
a. somerar is 15
b. somerar is 16
c. somerar is 1
d. somerar is $ somerar
13. Variable scope on which a variable does not loose its value when the function exists
and use that value if the function is called again is:
a. Local
b. function parameter
c. static
d. None of above
a. percentage
b. bitwise or
c. division
d. modulus
15. The left associative dot operator (.) is used in PHP for
a. multiplication
b. concatenation
d. delimeter
a. Any code found within an included file will inherit the variable scope of the
location of its caller
b. Because the included code will be embedded in a PHP execution block, the PHP
execution block, the PHP escape tags (<?php?> aren't required on the file to be
included
c. For the inclusion of remote files the allow-url-pope must be enabled ad URL
wrapper must be supported
d. Including a file produces the same result as copying the data from the file specified
into the location in which the statement appears.
17. Which of the following functions require the allow-url-fopen must be enabled?
a. include()
b. require()
c. both of above
d. None of above
18. Which function includes the specified file even the statement evaluates to false in
which block the function is placed.
a. include ()
b. require ()
c. both of above
d. None of above
19. On failure of which statement the script execution stops displaying error/warning
message?
a. rinclude ()
b. require ()
c. both of above
d. None of above
20. Trace the function that does continue the script execution even if the file inclusion
fails
a. include ()
b. require ()
c. both of above
d. None of above
21.Create a Product class whose data member are set private [id,name,type,description]
You call them using method inside class using setters and getters and display out
using objects.
CSS/HTML
1. The amount of space between letters can be specified using the __________
property in a style rule.
a. letter-kerning
b. letter-leading
c. letter-spacing
d. letter-buffer
2. When a visitor clicks the submit button on a form, the ______ of each form element
is sent.
a. label
b. name
c. value
d. name-value pair
3. In a table, the CSS __________ property can be used to specify the amount of
space between the borders of each cell.
a. border-padding
b. padding
c. spacing
d. border-spacing
4. To make the width of a table adjust to the current width of the viewer's browser
window, you should specify a table width of __________:
a. 100%
b. 640 pixels
c. 1024 pixels
d. none of the above
6. In the head section of each (X)HTML page in which you wish to use an external style
sheet, you must include an appropriate ______ element.
a.
b.
c.
2. When a user views a page containing a JavaScript program, which machine actually executes
the script?
A. The User's machine running a Web browser
B. The Web server
C. A central machine deep within Netscape's corporate offices
D. None of the above
6. _____ JavaScript statements embedded in an HTML page can respond to user events such
as mouse-clicks, form input, and page navigation.
A. Client-side
B. Server-side
C. Local
D. Native