Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
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 2 :
what will the ouptut of below date() function ?
<?php
$date="2009-5-19";
$time="14:31:38";
$datetime=$date.$time;
echo date("Y-m-d:H:i:s",strtotime($datetime));
?>
(A) 2009-5-19:14:31:38
(B) 19-5-2009:2:31:38
(C) 2009-5-19:2:31:38
(D) 19/5/2009:14:31:38
Ques 3 :
Which of the following is not a session function?
(A) session_destroy
(B) session_decode
(C) session_id
(D) session_pw
Ques 4 :
^[A-Za-z].* matches
(A) play it again
(B) I
(C) both (A) and (B)
(D) 123
Ques 5 :
When uploading a file if the UPLOAD_ERR-OK contains value 0 it means.
(A) Uploaded file size is 0
(B) Uplaod is not successful, error occurred
(C) The file uploaded with success
(D) File upload progress is 0% completed
Ques 6 :
In PHP, during error handling include() generates....................
(A) a fatal error, and the script will stop
(B) a warning, but the script will continue execution
(C) None of the above
Ques 7 :
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 8 :
Which of following are compound data type?
(A) Array
(B) Objects
(C) Both
(D) None
Ques 9 :
^[0-9]{5}(\-[0-9]{4})?$ matches
(A) 9001 and 12-4321\
(B) 90001 and 90002-4323
Ques 10 :
what will be the output of below code ?
<?php
function zz(& $x)
{
$x=$x+5;
}
?>
<? php
$x=10;
zz($x);
echo $x;
?>
(A) 0
(B) 5
(C) 10
(D) 15
Ques 11 :
Trace the false statement
(A) Because the included code will be embedded in a PHP execution block, the PHP execution block, the PHP escape tags ( aren't required on the file to be includeD.
(B) Any code found within an included file will inherit the variable scope of the location of its caller
(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.
Ques 12 :
Is it possible to submit a form with out a submit button?
(A) Yes
(B) No
Ques 13 :
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 14 :
What is the best all-purpose way of comparing two strings?
(A) Using the strpos function
(B) Using the == operator
(C) Using strcasecmp()
(D) Using strcmp()
Ques 15 :
Which of the following delimiter syntax is PHP's default delimiter syntax.
a. <% %>
b. <?php?>
c. <? ?>
d. <script language="php"> </script>
(A) a
(B) b
(C) c
(D) d
Ques 16 :
Are there regular expressions in PHP?
(A) Yes - regular expressions use Perl-like conventions
(B) Yes - PHP supports two different types of regular expressions: POSIX-extended and Perl-Compatible Regular Expressions (PCRE).
(C) Yes - regular expressions use the POSIX standard
(D) No - PHP uses "glob" style matching only
Ques 17 :
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 18 :
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 19 :
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 20 :
Which of following commenting is supported by Php.
(A) Shell syntax - #
(B) Multiline Comment /* ------------- */
(C) Both of above
(D) None of above
Submit Answer
Don't Refresh the Page !! ...