Hi, very simple piece of code that I'm having horrible problems with and I can't see why - probably staring me right in the face and I haven't noticed it! I'm trying to create an array of the alphabet and output each letter separately as a link using a foreach loop. I've got this code written:
<?php
$alphabet = range (A, Z);
foreach ($alphabet as $value) {
echo '<a href="browse.php" class="text2">$value</a>*';
}
?>
However, when I ran it, I get "$value" links written 26 times instead of the actual letters. I've tried changing the way I create the array to $alphabet = array ('A', 'B'....) but still no luck, just "$value" printed out 26 times.
Thanks,
Sam
<?php
$alphabet = range (A, Z);
foreach ($alphabet as $value) {
echo '<a href="browse.php" class="text2">$value</a>*';
}
?>
However, when I ran it, I get "$value" links written 26 times instead of the actual letters. I've tried changing the way I create the array to $alphabet = array ('A', 'B'....) but still no luck, just "$value" printed out 26 times.
Thanks,
Sam