lms prelim quiz Flashcards
What does PHP stands for?
Hypertext Preprocessor
Which PHP statement will give output $x on the screen?
a. echo “/$x”;
b. echo “$x”;
c. echo “$x;”;
d. echo “$$x”;
b. echo “$x”
Which of the following is the correct way to add a comment in PHP code?
a. /**/
b. #
c. All of the Method
c.
What is the port use by MySQL?
3306
What version of PHP introduced the advanced concepts of OOP?
PHP 5
<?php
$a = “$winner”;
$b = “/$looser”;
echo $a, $b;
?>
a. /$looser
b. $winner/$loosesr
c./
d. $looser
c
Which of the following statements will output Hello World on the screen?
i) echo (“Hello World”);
ii) print (“Hello World”);
iii) printf(“Hello World”);
iv) sprintf(“Hello World”);
a. i),ii), iii) and iv)
b.i), ii), and iii)
c. i) and ii)
d. i), ii), and iv)
b
What will be the output of the following PHP code?
<?php
define(“GREETING”, “PHP is a scripting language”);
echo $GREETING;
?>
no output
What is used to end a statement in PHP
semicolon
Which of the following PHP functions can be used to get the current memory usaage?
a. memory_get_usage()
b. get_peak_usage()
c. get_usage()
d. memory_get_peak_usage()
a. memory_get_usage()
Which of the following is not a variable scope in PHP
a. Static
b. Global
c. Loal
d. Extern
D. extern
Which of the following is used for concatenation in PHP
a. .(dot)
b. append()
c. +(plus)
d. *(askterisk)
a. .(dot)
String values in PHP must be enclosed within
Double quotes and single quotes
Which is the right way of declaring a variable in PHP?
a. $_hello
b. $3hello
c. $5_Hello
d.$this
a. $_hello
What is the default file extension of PHP file?
.php
<?php
$i = 5;
while (–$i > 0 && ++$i)
{
print $i;
}
?>
a. 54321
b. 5
c. error
d. 5555555…infinitely
d. 5555555…infinitely
What does PDO stands for?
PHP Data Object
What will be the output of the following PHP program?
<?php
define(“VAR_NAME”, “test”);
${VAR_NAME} = “value”;
echo VAR_NAME;
echo ${VAR_NAME};
?>
a. test
b.testvalue
c. error, constant value cannot be changed
d. testtest
b. testvalue