View Single Post
  #4  
Old 10-18-2012, 03:34 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
If you want to keep them in the same array do something like this:

PHP Code:
temp.events = {
  
"event", {3030"otherdata"},
  
"event2", {2020"loldata"}
};

temp.event_name "event";
temp.event_index temp.events.index(temp.event_name);
if (
temp.event_index >= 0) {
  
temp.event_data temp.events[temp.event_index+1];
  
// do stuff

The in operator will also work as well in this case.
__________________
Quote:
Reply With Quote