Question: I need a PHP code that display numbers from 1 to 10 and number 1 will be letter A, number 5 letter B and 9 Letter C, i maked it with FOR intruction but not so well..

```
<?php
 for($i=1;$i<=10;$i++)
 {   
   if ($i==1)
   {
       echo 'A';
   }
  echo "number:" .$i."<br />";  

 }

?>

```

Answer: 
Instead of having a bunch of `if`s, try making a map of numbers to letters.

```
$map = array(
    1 => 'A',
    5 => 'B',
    9 => 'C'
);
for($i=1; $i <= 10; $i++){
    // If the value is in the map, print the letter,
    // otherwise print the number
    echo array_key_exists($i, $map) ? $map[$i] : $i;
}

```
It's nearly impossible to understand what you're asking, but ...

```
for($i = 1; $i <= 10; $i++) {
    if($i == 1) {
        echo 'A';
    } elseif($i == 5) {
        echo 'B';
    } elseif($i == 9) {
        echo 'C';
    } else {
        echo $i;
    }
}

```

You could also use a `switch` statement for this.

Or, if you plan on expanding this more, an *associative array* might better suit your needs:

```
$letters = array(
    1 => 'A',
    5 => 'B',
    9 => 'C'
);

for($i = 1; $i <= 10; $i++) {
    if(array_key_exists($i, $letters)) {
        echo $letters[$i];
    } else {
        echo $i;
    }
}

```