Simplified guide of MCQs for Exams, Interviews

Sub Topic: PHP

1 .  What is a correct way to add a comment in PHP?

  • A. /*...*/
  • B. *\...\*
  • C. <!--...-->
  • D. <comment>...</comment>

Correct Answer:

/*...*/


2 .  PHP allows you to send emails directly from a script

  • A. True
  • B. False

Correct Answer:

True


3 .  Include files must have the file extension ".inc"

  • A. False
  • B. True

Correct Answer:

False


4 .  When using the POST method, variables are displayed in the URL

  • A. False
  • B. True

Correct Answer:

False


5 .  The PHP syntax is most similar to

  • A. Perl and C
  • B. VBScript
  • C. JavaScript

Correct Answer:

Perl and C


6 .  What is the correct way to end a PHP statement?

  • A. ;
  • B. New line
  • C. </php>

Correct Answer:

;


7 .  Which command will be used to print data?

  • A. echo "mcqsbucket.com";
  • B. Echo mcqsbucket.com
  • C. Print "mcqsbucket.com";
  • D. Print_r mcqsbucket.com

Correct Answer:

echo "mcqsbucket.com";