Basic PHP Quiz - 5

Basic PHP Quiz - 5

10 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

Include files must have the file extension ".inc"

  1. True
  2. False
Question 2 Multiple Choice (Single Answer)

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

  1. True
  2. False
Question 3 Multiple Choice (Single Answer)

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

  1. <!--include file="time.inc"-->
  2. <?php include_file("time.inc"); ?>
  3. <?php require("time.inc"); ?>
  4. <% include file="time.inc" %>
Question 4 Multiple Choice (Single Answer)

What is the correct way to create a function in PHP?

  1. function myFunction()
  2. new_function myFunction()
  3. create myFunction()
Question 5 Multiple Choice (Single Answer)

What is the correct way to connect to a MySQL database?

  1. mysql_open("localhost");
  2. connect_mysql("localhost");
  3. dbopen("localhost");
  4. mysql_connect("localhost");
Question 6 Multiple Choice (Single Answer)

What is the correct way to add 1 to the $count variable?

  1. count++;
  2. $count++;
  3. ++count
  4. $count =+1
Question 7 Multiple Choice (Single Answer)

PHP can be run on Microsoft Windows IIS(Internet Information Server):

  1. True
  2. False
Question 8 Multiple Choice (Single Answer)

In PHP 5, MySQL support is enabled by default:

  1. True
  2. False
Question 9 Multiple Choice (Single Answer)

Which one of these variables has an illegal name?

  1. $my-Var
  2. $myVar
  3. $my_Var
Question 10 Multiple Choice (Single Answer)

Which of the following regular expressions will match the string no.no.no?

  1. no?no?no
  2. nonono*
  3. ........
  4. ........