PHP Oneline Quiz

20 Questions | Total Attempts: 47

SettingsSettingsSettings
Please wait...
PHP Quizzes & Trivia

PHP is a vastly popular language in the programming and web development world, and today we’re going to see just how much you know about it, and how the language actually works. Think you know your stuff? Let’s find out!


Questions and Answers
  • 1. 
    What does PHP stand for?
    • A. 

      PHP: Hypertext Preprocessor

    • B. 

      Private Home Page

    • C. 

      Personal Hypertext Processor

  • 2. 
    PHP server scripts are surrounded by delimiters, which?
    • A. 

      ""

    • B. 

      ""

    • C. 

      "..."

  • 3. 
    How do you write "Hello World" in PHP?
    • A. 

      Echo "Hello World";

    • B. 

      "Hello World";

    • C. 

      Document.Write("Hello World");

  • 4. 
    All variables in PHP start with which symbol?
    • A. 

      " & "

    • B. 

      " # "

    • C. 

      " $ "

  • 5. 
    What is the correct way to end a PHP statement?
    • A. 

      ;

    • B. 

      ""

    • C. 

      Point

  • 6. 
    PHP syntax is more similar to
    • A. 

      Perl and C

    • B. 

      Javascript

    • C. 

      C#

  • 7. 
    How do you get information from a form that is submitted using the "get" method?
    • A. 

      Request.QueryString;

    • B. 

      $_GET[];

    • C. 

      Request.Form;

  • 8. 
    When using the POST method, variables are displayed in the URL:
    • A. 

      True

    • B. 

      False

  • 9. 
    In PHP you can use both single quotes ( ' ' ) and double quotes ( " " ) for strings:
    • A. 

      True

    • B. 

      False

  • 10. 
    Include files must have the file extension ".inc"
    • A. 

      True

    • B. 

      False

  • 11. 
    What is the correct way to include the file "time.inc" ?
    • A. 

      ""

    • B. 

      ""

    • C. 

      ""

  • 12. 
    What is the correct way to create a function in PHP?
    • A. 

      Function myFunction()

    • B. 

      Create myFunction()

    • C. 

      New_function myFunction()

  • 13. 
    What is the correct way to open the file "time.txt" as readable?
    • A. 

      Fopen("time.txt","r");

    • B. 

      Open("time.txt","read")

    • C. 

      Fopen("time.txt","r");

  • 14. 
    PHP allows you to send emails directly from a script ?
    • A. 

      True

    • B. 

      False

  • 15. 
    What is the correct way to connect to a MySQL database?
    • A. 

      Mysql_connect("localhost");

    • B. 

      Connect_mysql("localhost");

    • C. 

      Dbopen("localhost")

  • 16. 
    What is the correct way to add 1 to the $count variable?
    • A. 

      $count++;

    • B. 

      $count =+1

    • C. 

      ++count

  • 17. 
    What is a correct way to add a comment in PHP?
    • A. 

      ""

    • B. 

      /*…*/

    • C. 

      *\..\*

  • 18. 
    PHP can be run on Microsoft Windows IIS(Internet Information Server):
    • A. 

      True

    • B. 

      False

  • 19. 
    In PHP, the die() and exit() functions do the exact same thing.
    • A. 

      True

    • B. 

      False

  • 20. 
    Which one of these variables has an illegal name?
    • A. 

      $myVar

    • B. 

      $my_Var

    • C. 

      $my-Var