Hi, Saturday, September 20, 2003, 12:49:52 AM, you wrote: MM> I am having a total brain cramp with this array problem (may have to do with MM> the pressure change from the hurricane - but whatever ;) )
MM> $helpsystem[onlineusignuphelp_username]='The username that you choose must MM> be more than 5 characters and 20 or less characters in length. The username MM> must contain only numbers and letters.'; MM> $helpsystem[onlineusignuphelp_password]='The password that you choose must MM> be more than 5 characters and 26 or less characters in length. The username MM> may contain only numbers,letters, and the following characters:<br>! @ # % ^ MM> *'; MM> I am building a help system of sorts. I have the following 2 array members MM> above (set exactly as such). When I call the page it displays like: MM> Print $helpsystem[$_GET[tip]] MM> I would like to display a next and previous link to help items where MM> possible, the problem that I am having is figureing out how to get the next MM> and previous indexes. I can get the current key with the key() function, MM> and the text for the next and previous using next() and and prev() but MM> because the help is called by the key, I need the index to call the array MM> item in the url: MM> Help.php?tip=onlinusignuphelp_password MM> I cannot seem to find a way to get even the current index number (i.e. 0) so MM> that I can add and subtract one to that index number... Can anyone help out MM> with a pointer on how to get the next and prev keys? MM> Thanks ;) MM> -- MM> Cheers MM> Mike Morton MM> **************************************************** MM> * MM> * Tel: 905-465-1263 MM> * Email: [EMAIL PROTECTED] MM> * MM> **************************************************** MM> "Indeed, it would not be an exaggeration to describe the history of the MM> computer industry for the past decade as a massive effort to keep up with MM> Apple." MM> - Byte Magazine MM> Given infinite time, 100 monkeys could type out the complete works of MM> Shakespeare. Win 98 source code? Eight monkeys, five minutes. MM> -- NullGrey One way is to change your array layout like this $helpsystem = array( 0 => array( 'title'=>'username', 'content'=>'The username that you choose must....'), 1 => array( 'title' =>'password', 'content'=>'The password that you choose must....)); Then it is easy to navigate as the next and previous will always be numerical keys -- regards, Tom -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php