Time remaining
:
:
Test Status
PHPRANDOMTEST
Ques 1 :
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 2 :
The PHP syntax is most similar to
(A) PERL and C
(B) Java script
(C) VB Script
(D) Visual Basic
Ques 3 :
Father of PHP?
(A) Larry Wall
(B) Guido Van Rossum
(C) Rasmus Lerdorf
(D) James Gosling
Ques 4 :
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 5 :
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 6 :
To produce the output I love the summer time, Which of the following statement should be used?
a. <?php print("<P>I love the summer time</p>");?>
b. <?php $season = "summer time"; print("<P>I love the $season</p>"); ?>
c. <?php $message = "I love the $season"; echo $message; ?>
(A) a
(B) a and c
(C) a and b
(D) All of the above
Ques 7 :
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. 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.
(C) PHP interfaces to a number of relational databases such as MySQL, Oracle and Sybase but the interface differs in each case.
(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 8 :
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 9 :
How would you add 1 to the variable $count?
(A) incr count;
(B) $count++;
(C) $count =+1
(D) incr $count;
Ques 10 :
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 11 :
Whether One-line comment begin with pound sing(#) in php?
(A) True
(B) False
(C) None of above
Ques 12 :
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 13 :
The left associative dot operator (.) is used in PHP for ?
(A) multiplication
(B) concatenation
(C) separate object and its member
(D) delimeter
Ques 14 :
PHP code is embedded directly into XHTML document?
(A) False
(B) True
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 :
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 17 :
In PHP the error control operator is _______ ?
(A) .
(B) *
(C) @
(D) &
Ques 18 :
Which of the following functions require the allow-url-fopen must be enabled?
(A) require()
(B) include()
(C) both of above
(D) None of above
Ques 19 :
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 20 :
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
Submit Answer
Don't Refresh the Page !! ...