Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
Which of the following variables is not a predefined variable?
(A) $request
(B) $ask
(C) $get
(D) $post
Ques 2 :
what will be the ouput of below code ?
define("x","5");
$x=x+10;
echo x;
?>
(A) Error
(B) 5
(C) 10
(D) 15
Ques 3 :
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 any delimiting style but must use a single style consistently for a page
(C) You can use different delimiting styles in same page
(D) Variables declared in previous blocks are remembered on later blocks too!
Ques 4 :
what is the return value of this substr function?
<?php
$rest = substr("abcdef", -1);
$rest = substr("abcdef", 0, -1);
?>
(A) f,abcde
(B) b,abcdef
(C) a,fedcb
(D) a,abcde
Ques 5 :
Father of PHP?
(A) Larry Wall
(B) Guido Van Rossum
(C) Rasmus Lerdorf
(D) James Gosling
Ques 6 :
what is the return value of this substr function?
<?php
$rest = substr("abcdef", -1);
$rest = substr("abcdef", 0, -1);
?>
(A) f,abcde
(B) b,abcdef
(C) a,fedcb
(D) a,abcde
Ques 7 :
Which of the following is used to check if a function has already been defined?
(A) bool function_exists(functionname)
(B) bool func_exist(functioname)
(C) bool f_exists(functionname)
Ques 8 :
Father of PHP?
(A) Larry Wall
(B) Rasmus Lerdorf
(C) James Gosling
(D) Guido Van Rossum
Ques 9 :
What is the out put.
<?php
$x=array("aaa","ttt","www","ttt","yyy","tttt");
$y=array_count_values($x);
echo $y[ttt];
?>
(A) 2
(B) 3
(C) 1
(D) 4
Ques 10 :
On failure of which statement the script execution stops displaying error/warning message?
(A) include ()
(B) require ()
(C) both of above
(D) None of above
Ques 11 :
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 12 :
What is the output ?
<?php define("x","5"); $x=x+10; echo x; ?>
(A) 10
(B) 5
(C) Error
(D) 15
Ques 13 :
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 14 :
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 15 :
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 16 :
Which operator is used to concatenate two strings in php?
(A) dot operator (.)
(B) plus operator (+)
Ques 17 :
The left associative dot operator (.) is used in PHP for ?
(A) multiplication
(B) concatenation
(C) separate object and its member
(D) delimeter
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 :
The left association operator % is used in PHP for
(A) modulus
(B) percentage
(C) bitwise
(D) division
Ques 20 :
The PHP syntax is most similar to
(A) PERL and C
(B) Java script
(C) VB Script
(D) Visual Basic
Submit Answer
Don't Refresh the Page !! ...