Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
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 2 :
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 3 :
what will be the output of below code ?
<? php
$data="98.8degrees";
(double)$data;
(int)$data;
(string)$string;
echo $data;
?>
(A) 98
(B) 98.8
(C) 98.8degrees
(D) degrees
Ques 4 :
what will be the output of below code ?
<?php
$arr = array(5 => 1, 12 => 2);
$arr[] = 56;
$arr["x"] = 42;
unset($arr);
echo var_dump($arr);
?>
(A) 42
(B) 56
(C) Null
(D) x=42
Ques 5 :
Which of the following functions require the allow-url-fopen must be enabled?
(A) include()
(B) require()
(C) both of above
(D) None of above
Ques 6 :
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 7 :
Study following steps and determine the correct order.
(1) Open a connection to MySql server
(2) Execute the SQL query
(3) Fetch the data from query
(4) Select database
(5) Close Connection
(A) 1, 5, 4, 2, 1
(B) 1, 4, 2, 3, 5
(C) 4, 1, 2, 3, 5
(D) 4, 1, 3, 2, 5
Ques 8 :
^[A-Za-z].* matches
(A) play it again
(B) I
(C) both (A) and (B)
(D) 123
Ques 9 :
Is php can support multiple inheritance?
(A) NO
(B) YES
Ques 10 :
Which of the following function returns the number of characters in a string variable?
(A) len($variable)
(B) count($variable)
(C) strcount($variable)
(D) strlen($variable)
Ques 11 :
The PHP syntax is most similar to
(A) PERL and C
(B) Java script
(C) VB Script
(D) Visual Basic
Ques 12 :
Which of the following functions can be used to determine the integrity of a string?
(A) md5()
(B) sha1()
(C) crc32()
(D) all of the above
Ques 13 :
Which of the following delimiting method is known as string Interpolation
(A) delimited by single quote
(B) delimited by double quote
(C) delimited by <<< identifier
(D) All of above
Ques 14 :
In PHP the error control operator is _______
(A) .
(B) @
(C) *
(D) &
Ques 15 :
What is the output ?
<?php $x=array(1,3,2,3,7,8,9,7,3); $y=array_count_values($x); echo $y[8]; ?>
(A) 43
(B) 1
(C) 6
(D) 8
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 :
Which of the following statement produce different output.
a. <P="This is php example"; ?>
b. <?echo "This is php example"; ?>
c. <?PHP echo "This is php example"; php?>
d. <script language="php"> print "This is php example";</script>
(A) a
(B) b
(C) c
(D) d
Ques 18 :
Trace the odd data type?
(A) floats
(B) integer
(C) doubles
(D) Real number
Ques 19 :
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) Local
(B) function parameter
(C) static
(D) None of above
Ques 20 :
Identify the variable scope that is not supported by PHP ?
(A) Local variables
(B) Function parameters
(C) Hidden variables
(D) Global variables
Submit Answer
Don't Refresh the Page !! ...