Register|Login

Have a question? Click here to ask the community.

Quiz 7 – Arrays

| In: PHP Quizzes | 29,143 views

*You are currently not logged in and your quiz score will not be recorded. Please login or register if you would like to submit your quiz score.

Directions: Answer all questions. Any questions skipped will be scored as wrong answers. Good Luck! :)

1. An array can store multiple numbers or text strings in a single variable?

True
False

2. A numeric array stores each array element (numbers or text strings) with a numeric index?

True
False

3. From the following php scripting block, what will be displayed in the browser:

<?php
$array[3] = “Tommy has a red ball”;
echo $array[3];
?>

Nothing will show
Tommy has a red ball
$array[3]
All of the above

4. In the following example the numeric index is automatically assigned?

<?php
$toys = array(“Truck”,”Boat”,”Doll”);
?>

True
False

5. From the following php scripting block, what will be displayed in the browser:

<?php
$array[0] = “mall”;
$array[1] = “Kate”;
$array[2] = 9;
$array[3] = “brother”;
$array[4] = “cup cakes”;
$array[5] = “store”;
$array[6] = “Linda”;

echo “$array[1] went to the $array[0] to buy $array[2] $array[4] for her $array[3].”;
?>

Linda went to the mall to buy 9 cup cakes for her brother.
Kate went to the store to buy 9 cup cakes for her brother.
Linda went to the store to buy 9 cup cakes for her brother.
Kate went to the mall to buy 9 cup cakes for her brother.



2 Responses to Quiz 7 – Arrays

Avatar

Angela Flowers

May 9th, 2011 at 5:28 am

This tutorial was quite difficult! I had to study it 4 times before I got it :)

Avatar

Jake Smith

October 6th, 2011 at 5:29 am

The quiz is quite easy man! No more tough questions?? All the php quiz on the net are like this! Damn easy quiz!

Comment Form

You must be logged in to post a comment.

Users Online

Users Online: 2 Users

Most Users Ever Online: 91

Quiz Scores

Advertisments