Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
Which of following variable assignment is 'by value' assignment in PHP
(A) $value1= $value?
(B) $value1= & $value?
(C) $value1= & $value?
(D) None
Ques 2 :
What's the best way to copy a file from within a piece of PHP?
(A) Print out a message asking your user to "telnet" in to the server and copy the file for you
(B) Open the input and output files, and use read() and write() to copy the data block by block until read() returns a zero
(C) Use the built in copy() function
(D) Use "exec" to run an operating system command such as cp (Unix, Linux) or copy (Windows)
Ques 3 :
To produce the output I love the summer time, Which of the following 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 = "I love the $season"; echo $message; ?>
(A) a
(B) a and c
(C) a and b
(D) All of the above
Ques 4 :
What is the out put.
<?php
$x=array(1,3,2,3,7,8,9,7,3);
$y=array_count_values($x);
echo $y[8];
?>
(A) 43
(B) 8
(C) 1
(D) 6
Ques 5 :
What is the out put
<?php
$father="mother";
$mother="son";
echo $$father;
?>
(A) son
(B) mother
(C) motherson
(D) error
Ques 6 :
Identify the invalid identifier
(A) â??some word
(B) size
(C) my-function
(D) This&that
Ques 7 :
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) static
(B) Local
(C) function parameter
(D) None of above
Ques 8 :
In php Which method is used to getting browser properties?
(A) $_SERVER['PHP_SELF']
(B) $_SERVER['SERVER_NAME']
(C) $_SERVER['HTTP_USER_AGENT'];
(D) $_SERVER['HTTP_VARIENT']
Ques 9 :
what will be the output of below code ?
<?php
$x=dir(".");
while($y=$x->read())
{
echo $y."
"
}
$y->close();
?>
(A) display content of the all drives
(B) display a folder content
(C) display all folder names
(D) Parse error
Ques 10 :
Which of the following is not a valid variable name?
(A) $nic
(B) $number-in-class
(C) $NumberInClass
(D) $number_in_class
Ques 11 :
Is it possible to submit a form with out a submit button?
(A) Yes
(B) No
Ques 12 :
When defining identifier in PHP you should remember that
(A) Identifier are case sensitive. So $result is different than $ result
(B) Identifiers can be any length
(C) Both of above
(D) None of above
Ques 13 :
Which operator is used to concatenate two strings in php?
(A) dot operator (.)
(B) plus operator (+)
Ques 14 :
Which of the following is used to check if a function has already been defined?
(A) bool func_exist(functioname)
(B) bool function_exists(functionname)
(C) bool f_exists(functionname)
Ques 15 :
What happens if you add a string to an integer using the + operator?
(A) The interpreter outputs a type mismatch error
(B) The string is converted to a number and added to the integer
(C) The string is discarded and the integer is preserved
(D) The integer and string are concatenated together in a new string
Ques 16 :
Which of the following function is used for terminate the script execution in PHP?
(A) break()
(B) quit()
(C) die()
Ques 17 :
What function used to print statement in PHP?
(A) echo();
(B) printf
(C) ""
Ques 18 :
Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you used basename($_SERVER['PHP_SELF']) function in your page, then what is the return value of this function ?
(A) phptutor
(B) phptutor/index.php
(C) index.php
(D) /index.php
Ques 19 :
On failure of which statement the script execution stops displaying error/warning message?
(A) reinclude ()
(B) require ()
(C) both of above
(D) None of above
Ques 20 :
what will be the output of below code ?
<? php
$str="3dollars";
$a=20;
$a+=$str;
print($a);
?>
(A) 320dollars
(B) 203dollars
(C) 23dollars
(D) 23
Submit Answer
Don't Refresh the Page !! ...