Re: ForEach Range Problems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 31, 2009 at 2:51 PM, Miller,
Terion<tmiller@xxxxxxxxxxxxxxxxxxxx> wrote:
>
>
>
> --snip---
>
> --
> Well I almost have it with this, I keep getting an undefined index $letter error though and then it outputs the $menu how do I fix that
>
>  //Create array with letters AND number sign                          $letters = range('A','Z');                          array_push($letters, '#');                                                    $menu = '';                          foreach($letters as $letter) {                              $menu .= ($letter == $_GET['letter'])                                ? sprintf('%s&nbsp', $letter)                                : sprintf('<a href="browse.php?letter=%s">%s</a>&nbsp;', $letter, $letter);                          }
>



What if you just add a

$letters = '';

at the top?

-- 

Bastien

Cat, the other other white meat

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux