Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
The ___________ function can be used to compare two strings using a case-insensitive binary algorithm ?
(A) strcmp()
(B) stricmp()
(C) strcasecmp()
(D) stristr()
Ques 2 :
what will be the output of below code ?
<?php
$qpt = 'QualityPointTechnologies';
echo preg_match("/^Quality/", $qpt);
?>
(A) 0
(B) 1
(C) Quality
(D) Null
Ques 3 :
what will be the output of below code ?
$x="101.5degrees";
(double)$x;
(int)$x;
echo (string)$x;
?>
(A) 101.5
(B) degrees
(C) 101
(D) 101.5degrees
Ques 4 :
Identify the variable scope that is not supported by PHP ?
(A) Local variables
(B) Function parameters
(C) Hidden variables
(D) Global variables
Ques 5 :
Which of the following function is used to pick one or more random values from PHP Array?
(A) Random_array()
(B) array_random()
(C) Rand_array()
(D) array_rand()
Ques 6 :
In php Which method is used to getting browser properties?
(A) $_SERVER['PHP_SELF']
(B) $_SERVER['HTTP_VARIENT']
(C) $_SERVER['HTTP_USER_AGENT'];
(D) $_SERVER['SERVER_NAME']
Ques 7 :
Which of following commenting is supported by Php.
(A) Shell syntax - #
(B) Multiline Comment /* ------------- */
(C) Both of above
(D) None of above
Ques 8 :
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 9 :
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 10 :
Which of these statements is true?
(A) PHP interfaces to the MySQL database,and you should transfer any data in Oracle or Sybase to MySQL if you want to use PHP on the data.
(B) PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase but the interface differs in each case.
(C) PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase. A wrapper layer is provided so that code written for one database can easily be transferred to another if you later switch your database engine.
(D) There's little code in PHP to help you interface to databases, but there's no reason why you can't write such code if you want to.
Ques 11 :
In PHP the error control operator is _______
(A) .
(B) @
(C) *
(D) &
Ques 12 :
Which of the following method sends input to a script via a URL?
(A) Get
(B) Post
(C) Both
(D) None
Ques 13 :
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 14 :
Which operator is used to concatenate two strings in php?
(A) dot operator (.)
(B) plus operator (+)
Ques 15 :
<? 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 16 :
When you need to obtain the ASCII value of a character which of the following function you apply in PHP?
(A) asc( );
(B) ord( );
(C) chr( );
(D) val( );
Ques 17 :
Which of the following functions can be used to convert the binary data stored in a string into its hexadecimal representation?
(A) encode_hex()
(B) pack()
(C) hex2bin()
(D) bin2hex()
Ques 18 :
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 19 :
What's the best way to copy a file from within a piece of PHP?
(A) 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 20 :
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
Submit Answer
Don't Refresh the Page !! ...