需要根据数组的值显示文本

I have an assignment where a random prize must be awarded based on the number the user chooses. Once that number is chosen it is stored and the array is shuffled and the prize is displayed. I have that figured out but I also need text to be displayed based on what prize it ends up being and im getting stuck.

$award = array("bmw.jpg", "puppy.jpg", "grocery.jpg", "pen.jpg",          "gas.jpg", "iphone.jpg");
shuffle($award);
?>

<?php
echo '<img src="'. $award[$_GET["number"]].'" width="217" align="middle" >';
if($award['. $award[$_GET["number"]].'] == "bmw.jpg")
{
  echo '<p>Congrats you won the grand prize</p>';
}
?>

change your if statement like this:

<?php

if($award[$_GET["number"]] == "bmw.jpg")
{
   echo '<p>Congrats you won the grand prize</p>';
}
?>

hope this helps.

$award = array("bmw.jpg", "puppy.jpg", "grocery.jpg", "pen.jpg", "gas.jpg", "iphone.jpg");
shuffle($award);
$text = array("BMW", "Puppy", "Grocery", "Pen", "Gas", "Iphone");

?>

<?php
echo '<img src="'. $award[$_GET["number"]].'" width="217" align="middle" >';
if($award[$_GET["number"]] == "bmw.jpg")
{
  echo '<p>Congrats you have won '.$text[$_GET["number"]].' the grand prize</p>';
}
?>