AMP

Chapter 4: PHP: Hypertext Preprocessor — Online MCQ Test

COMPUTER APPLICATIONS · CLASS 12th · Tamil Nadu State Board
Practice Chapter 4: PHP: Hypertext Preprocessor with a free chapter-wise online MCQ test. This chapter covers: Introducing server-side scripting this chapter covers PHP architecture syntax data types variables operators and echo statements. Students learn how PHP scripts execute on web serv.... AI-generated questions from basic to board-exam level, with instant results and explanations.

Start Exam on Full Site →

Chapter 4: PHP: Hypertext Preprocessor — Important Questions & Answers

What does PHP stand for?
  • A. Personal Hypertext Processor
  • B. Hypertext Preprocessor
  • C. Programming Hyperlink Protocol
  • D. Pre Hypertext Processor
Answer: B. Hypertext Preprocessor
PHP stands for Hypertext Preprocessor. It is a server-side scripting language used to create dynamic web pages.
Which symbol is used to start a PHP variable name?
  • A. #
  • B. &
  • C. $
  • D. @
Answer: C. $
In PHP, all variable names begin with the dollar symbol ($), such as $name or $age.
Which of the following best describes PHP?
  • A. A client-side scripting language
  • B. A server-side scripting language
  • C. A database management system
  • D. A computer hardware language
Answer: B. A server-side scripting language
PHP executes on the web server before the page is sent to the browser. So it is called a server-side scripting language.
Which statement about PHP execution is correct?
  • A. PHP code is executed in the browser after the page is displayed
  • B. PHP code is executed on the server before the HTML is sent to the browser
  • C. PHP code is compiled into machine code permanently before running
  • D. PHP code cannot generate HTML content dynamically
Answer: B. PHP code is executed on the server before the HTML is sent to the browser
PHP runs on the server. The server processes the script and sends only the generated HTML output to the browser.
Which of the following PHP statements will display the value of $name and a newline-like separation most appropriately in a web page?
  • A. echo '$name';
  • B. echo "$name";
  • C. echo $name;
  • D. echo "$name<br>";
Answer: D. echo "$name<br>";
The <br> tag creates a line break in HTML output, making the displayed content appear separated on the web page. This is useful when formatting output with echo.