Re: Brain cramp with arrays
| From: | Jonathan Duncan | Date: | Fri, 19 Sep 2003 15:33:17 +0000 |
| Subject: | Re: Brain cramp with arrays | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-163169@lists.php.net to get a copy of this message | ||
Mike,
Have you looked at the Next:
http://us2.php.net/manual/en/function.next.php
and Previous:
http://us2.php.net/manual/en/function.prev.php
... functions?
Regards,
Jonathan Duncan
"Mike Morton" <mike@webtraxx.com> wrote in message
news:BB908FD0.1A1B8%mike@webtraxx.com...
> I am having a total brain cramp with this array problem (may have to do
with
> the pressure change from the hurricane - but whatever ;) )
>
> $helpsystem[onlineusignuphelp_username]='The username that you choose must
> be more than 5 characters and 20 or less characters in length. The
username
> must contain only numbers and letters.';
> $helpsystem[onlineusignuphelp_password]='The password that you choose must
> be more than 5 characters and 26 or less characters in length. The
username
> may contain only numbers,letters, and the following characters:<br>! @ # %
^
> *';
>
> I am building a help system of sorts. I have the following 2 array
members
> above (set exactly as such). When I call the page it displays like:
>
> Print $helpsystem[$_GET[tip]]
>
> I would like to display a next and previous link to help items where
> possible, the problem that I am having is figureing out how to get the
next
> and previous indexes. I can get the current key with the key() function,
> and the text for the next and previous using next() and and prev() but
> because the help is called by the key, I need the index to call the array
> item in the url:
> Help.php?tip=onlinusignuphelp_password
>
> I cannot seem to find a way to get even the current index number (i.e. 0)
so
> that I can add and subtract one to that index number... Can anyone help
out
> with a pointer on how to get the next and prev keys?
>
> Thanks ;)
>
> --
> Cheers
>
> Mike Morton
>
> ****************************************************
> *
> * Tel: 905-465-1263
> * Email: mike@webtraxx.com
> *
> ****************************************************
>
> "Indeed, it would not be an exaggeration to describe the history of the
> computer industry for the past decade as a massive effort to keep up with
> Apple."
> - Byte Magazine
>
> Given infinite time, 100 monkeys could type out the complete works of
> Shakespeare. Win 98 source code? Eight monkeys, five minutes.
> -- NullGrey