• HOME
  • QUIZ
  • CONTACT US
EXAMIANS
  • COMPUTER
  • CURRENT AFFAIRS
  • ENGINEERING
    • Chemical Engineering
    • Civil Engineering
    • Computer Engineering
    • Electrical Engineering
    • Mechanical Engineering
  • ENGLISH GRAMMAR
  • GK
  • GUJARATI MCQ

PHP Control Structures (Loop)

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$a = "1";
$a = 1;
$b = 1;
switch($a) {
case $a * $b:
print "hi";
break;
case $a / $b:
print "hello";
break;
default:
print "hi1";
}

hi1
hi
hihellohi1
hihello

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$a = "hello";
if (strlen($a))
print strlen($a);
else
print "hi";

error
hellolength
5
hi

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$a = "";
if ($a)
print "all";
if
else
print "some";

all
no output
error
some

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
for ($i = 0; $i < 5; $i++) {
for ($j = $i; $j > 0; $i--)
print $i;
}

no output
0 1 0 1 2 0 1 2 3 0 1 2 3 4 0 1 2 3 4 5 0 1 2 3 4 5
infinite loop
0 1 2 3 4 5

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$a = array("hi", "hello", "bye");
foreach ($a as $value) {
if (count($a) == 2)
print $value;
}

no output
hihellobye
hihello
infinite loop

ANSWER DOWNLOAD EXAMIANS APP

PHP Control Structures (Loop)
What will be the output of the following PHP code ?
$a = "2";
switch ($a) {
case 1:
print "hi";
case 2:
print "hello";
break;
default:
print "hi1";
}

hello
hi1
hihellohi1
hihi1

ANSWER DOWNLOAD EXAMIANS APP
MORE MCQ ON PHP Control Structures (Loop)

DOWNLOAD APP

  • APPLE
    from app store
  • ANDROID
    from play store

SEARCH

LOGIN HERE


  • GOOGLE

FIND US

  • 1.70K
    FOLLOW US
  • EXAMIANSSTUDY FOR YOUR DREAMS.
  • SUPPORT :SUPPORT EMAIL ACCOUNT : examians@yahoo.com

OTHER WEBSITES

  • GUJARATI MCQ
  • ACCOUNTIANS

QUICK LINKS

  • HOME
  • QUIZ
  • PRIVACY POLICY
  • DISCLAIMER
  • TERMS & CONDITIONS
  • CONTACT US
↑