Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
You can define a constant by using the define() function. Once a constant is defined
(A) It can never be changed or undefined
(B) It can be changed and can be undefined
(C) It can never be changed but can be undefined
(D) It can be changed but can not be undefined
Ques 2 :
How would you add 1 to the variable $count?
(A) incr count;
(B) $count++;
(C) $count =+1
(D) incr $count;
Ques 3 :
The output of following script would be
$somerar=15;
function ad it () {
GLOBAL $somevar;
$somerar++ ;
echo "somerar is $somerar";
}
addit ();
(A) somerar is 1
(B) somerar is 15
(C) somerar is 16
(D) somerar is $ somerar
Ques 4 :
Is it possible to submit a form with out a submit button?
(A) Yes
(B) No
Ques 5 :
Identify the invalid identifier ?
(A) my-function
(B) size
(C) -some word
(D) This&that
Ques 6 :
In mail($param1, $param2, $param3, $param4), the $param2 contains
(A) The message
(B) The header
(C) The recipient
(D) The subject
Ques 7 :
What is the out put
<?php
$color=array("red","yellow","white");
$x=in_array("black",$color);
if($x==0)
echo "good bye";
if($x==1) echo "Hello";
?>
(A) Error
(B) Hello
(C) good bye
(D) None of the above
Ques 8 :
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 9 :
In PHP, which of the following function is used to insert content of one php file into another php file before server executes it
(A) include[]
(B) #include()
(C) #include{}
(D) include()
Ques 10 :
What will be the ouput of below code ? Assume that today is 2009-5-19:2:45:32 pm
<?php
$today = date("F j, Y, g:i a");
?>
(A) May 19, 2009, 2:45 pm
(B) may 19,09,2:45:32 PM
(C) May 19,2009,14:45:32 pm
(D) May 19,2009,14:45:32 PM
Ques 11 :
Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you used $_SERVER['PHP_SELF'] function in your page, then what is the return value of this function ?
(A) phptutor/index.php
(B) /phptutor/index.php
(C) c:/apache/htdocs/phptutor/index.php
(D) index.php
Ques 12 :
Given a comma-separated list of values in a string, which function from the given list can create an array of each individual value with a single call?
(A) strstr()
(B) strtok()
(C) explode()
(D) extract()
Ques 13 :
Which of the following function is used for terminate the script execution in PHP?
(A) quit()
(B) break()
(C) die()
Ques 14 :
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 15 :
The PHP syntax is most similar to
(A) PERL and C
(B) Java script
(C) VB Script
(D) Visual Basic
Ques 16 :
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 17 :
Father of PHP?
(A) Larry Wall
(B) Guido Van Rossum
(C) Rasmus Lerdorf
(D) James Gosling
Ques 18 :
Assume that your php file 'index.php' in location c:/apache/htdocs/phptutor/index.php. If you used $_SERVER['PHP_SELF'] function in your page, then what is the return value of this function ?
(A) phptutor/index.php
(B) /phptutor/index.php
(C) c:/apache/htdocs/phptutor/index.php
(D) index.php
Ques 19 :
<? php
$x="display";
${$x.'_result'} ();
?>
Above program will call the function display_result()
(A) False
(B) True
(C) Parser Error
(D) None of the above
Ques 20 :
PHP is a _____ . It means you do not have to tell PHP which data type the variable is.PHP automatically converts the variable to the correct data type, depending on its value.
(A) client side language
(B) local language
(C) global language
(D) loosely typed language
Submit Answer
Don't Refresh the Page !! ...