FREE! Click here to Join FunTrivia. Thousands of games, quizzes, and lots more!
Quiz about PHP Basic Concepts
Quiz about PHP Basic Concepts

PHP Basic Concepts Trivia Quiz


Test your knowledge of one of the internet's most popular languages.

A multiple-choice quiz by kwdesigner. Estimated time: 3 mins.
  1. Home
  2. »
  3. Quizzes
  4. »
  5. Science Trivia
  6. »
  7. Computers
  8. »
  9. Software and Programming

Author
kwdesigner
Time
3 mins
Type
Multiple Choice
Quiz #
252,806
Updated
Dec 03 21
# Qns
10
Difficulty
Average
Avg Score
7 / 10
Plays
857
Last 3 plays: ozzz2002 (5/10), stephedm (3/10), masfon (8/10).
- -
Question 1 of 10
1. Which tag indicates the start of a block of PHP code? Hint


Question 2 of 10
2. A line of PHP code is terminated by this symbol... Hint


Question 3 of 10
3. Which tag may be used to indicate a comment in your PHP code? Hint


Question 4 of 10
4. When released in 1995, the name PHP originally stood for... Hint


Question 5 of 10
5. Variables in PHP start with what symbol? Hint


Question 6 of 10
6. Which one of these variables has an illegal name? Hint


Question 7 of 10
7. Which of the following would you use to display "Hello World" using PHP? Hint


Question 8 of 10
8. To add 1 to the variable $myNum, use the following: Hint


Question 9 of 10
9. Which of the following is NOT a predefined global PHP variable? Hint


Question 10 of 10
10. Which of the following comparison operators will return TRUE if $a is not equal to $b? Hint



(Optional) Create a Free FunTrivia ID to save the points you are about to earn:

arrow Select a User ID:
arrow Choose a Password:
arrow Your Email:




Most Recent Scores
Jul 08 2024 : ozzz2002: 5/10
Jul 08 2024 : stephedm: 3/10
Jul 08 2024 : masfon: 8/10
Jul 08 2024 : GoodwinPD: 10/10

Score Distribution

quiz
Quiz Answer Key and Fun Facts
1. Which tag indicates the start of a block of PHP code?

Answer: < ? php

PHP only parses code within its delimiters. Anything outside its delimiters is sent directly to the output and not parsed by PHP.
2. A line of PHP code is terminated by this symbol...

Answer: ;

PHP treats new lines as whitespace (except when inside string quotes). Statements are terminated by a semicolon, except in a few special cases.
3. Which tag may be used to indicate a comment in your PHP code?

Answer: All of these

// and /* * are also used in the C programming language which PHP was written in.
4. When released in 1995, the name PHP originally stood for...

Answer: Personal Home Page Tools

The original developer Rasmus Lerdorf released "Personal Home Page Tools" on June 8, 1995. A later development team chose the name "PHP: Hypertext Preprocessor."
5. Variables in PHP start with what symbol?

Answer: $

Variables must be prefixed with a dollar symbol and unlike function and class names, variable names are case sensitive.
6. Which one of these variables has an illegal name?

Answer: $my-new-variable

Dashes cannot be used in variable names.
7. Which of the following would you use to display "Hello World" using PHP?

Answer: echo 'Hello World' ;

You could also use the print() function to get a similar result.
8. To add 1 to the variable $myNum, use the following:

Answer: $myNum++ ;

The ++ operator increments a variable's value by one.
9. Which of the following is NOT a predefined global PHP variable?

Answer: $_GLOBALS

Most of the predefined "superglobal" variables in PHP begin with an underscore ($_GET, $_POST, $_FILES, $_ENV, $_SESSION), however $GLOBALS lacks the underscore.
10. Which of the following comparison operators will return TRUE if $a is not equal to $b?

Answer: $a != $b

Comparison operators allow you to compare two values.
Source: Author kwdesigner

This quiz was reviewed by FunTrivia editor crisw before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.
7/12/2024, Copyright 2024 FunTrivia, Inc. - Report an Error / Contact Us