# Simple PHP variable question- please help!

**URL:** <https://forum.kirupa.com/t/simple-php-variable-question-please-help/188077>\
**Category:** programming\
**Created:** [May 4, 2006, 11:48am UTC](https://forum.kirupa.com/t/simple-php-variable-question-please-help/188077 "2006-05-04T11:48:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![J\_S](https://avatars.discourse-cdn.com/v4/letter/j/9de0a6/32.png) [@J\_S](https://forum.kirupa.com/u/J_S)\
**Post date:** [May 4, 2006, 11:48am UTC](https://forum.kirupa.com/t/simple-php-variable-question-please-help/188077/1 "2006-05-04T11:48:29Z")

</div>

I am writing my first PHP site. I have specified 10 peoples names in 10 variables like this:

$guestName1==“Gary”  
$guestName2==“Kevin”  
$guestName3==“Steve”  
…and so on up to $guestName10.

I need to write a small script which exports the following text:

Dear Gary  
Dear Kevin  
Dear Steve  
…and so on up to the 10th name.

This is the code i’ve been using but it doesn’t work. How can I do it?

```auto

$guestName1=="Gary"
 $guestName2=="Kevin"
 $guestName3=="Steve"

for ($i = 1; $i <= 10; $i++) {
    echo ("Dear $guestName[$i]");
}

```
