PHP Multiple Choice Questions – While Loops

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “While Loops”. 1. What will be the output of the following PHP code? <?phpwhile(){ print "hi";}?> a) infinite loop b) hi c) no output d) error 2. What will be the output of the following PHP code? <?phpdo{ print "hi";}while(0);print "hello";?> a) infinite … Read more

advertisement

PHP Coding Questions and Answers – Switch

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Switch”. 1. What will be the output of the following PHP code? <?php$a = "1";switch ($a){case 1: print "hi";case 2: print "hello";default: print "hi1";}?> a) hihellohi1 b) hi c) hihi1 d) hi1 2. What will be the output of the following PHP code? … Read more

advertisement

PHP Coding Questions and Answers – If-Else-If – 3

This set of PHP Puzzles focuses on “If-Else-If – 3”. 1. What will be the output of the following PHP code? <?php$x = 10;$y = 5;$z = 3;if ($x / $y / $z) print "hi";else print "hello";?> a) hi b) hello c) error d) no output 2. What will be the output of the following … Read more

advertisement

PHP Coding Questions and Answers – If-Else-If-2

This set of PHP Question Bank focuses on ” If-Else-If-2″. 1. What will be the output of the following PHP code? <?php$x = 10;$y = 20;if ($x > $y + $y != 3) print "hi" ;else print "how are u";?> a) how are u b) hi c) error d) no output 2. What will be … Read more

advertisement

PHP Multiple Choice Questions – If – Else – If

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “If – Else – If”. 1. What will be the output of the following PHP code? <?php$x;if ($x) print "hi" ;else print "how are u";?> a) how are u b) hi c) error d) no output 2. What will be the output of … Read more

advertisement

PHP Coding Questions and Answers – Operators – 5

This set of Tough PHP Interview Questions & Answers focuses on “Operators – 5”. 1. What will be the output of the following PHP code? <?php$i = 0; $j = 1; $k = 2;print !(($i + $k) < ($j – $k));?> a) 1 b) true c) false d) 0 2. What will be the output … Read more

advertisement

PHP Coding Questions and Answers – Operators – 4

This set of PHP Questions and Answers for Campus interviews focuses on “Operators – 4”. 1. What will be the output of the following PHP code? <?phpecho 5 * 9 / 3 + 9;?> a) 24 b) 3.7 c) 3.85 d) 0 2. What will be the output of the following PHP code? <?php$var1 = … Read more

advertisement

PHP Coding Questions and Answers – Operators – 3

This set of PHP Questions and Answers for Entrance exams focuses on “Operators – 3”. 1. What will be the output of the following PHP code? <?phpecho 5 * 9 / 3 + 9;?> a) 24 b) 3.7 c) 3.85 d) 0 2. What will be the output of the following PHP code? <?phpecho 5 … Read more

advertisement

PHP Coding Questions and Answers – Operators – 2

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Operators – 2”. 1. What will be the output of the following PHP code? <?php$i = 0;while ($i = 10){ print "hi";}print "hello";?> a) hello b) infinite loop c) hihello d) error 2. What will be the output of the following PHP code? … Read more

advertisement

PHP Multiple Choice Questions – Operators

This set of PHP Multiple Choice Questions & Answers (MCQs) focuses on “Operators”. 1. What will be the output of the following PHP code? <?php$a = 10;echo ++$a;echo $a++;echo $a;echo ++$a;?> a) 11111213 b) 11121213 c) 11111212 d) 11111112 2. What will be the output of the following PHP code? <?php$a = 12;–$a;echo $a++;?> a) … Read more

advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.