View Single Post
  #2  
Old 04-16-2008, 03:08 AM
Tolnaftate2004 Tolnaftate2004 is offline
penguin.
Join Date: Jul 2004
Location: Berkeley, CA
Posts: 534
Tolnaftate2004 is a jewel in the roughTolnaftate2004 is a jewel in the rough
Send a message via AIM to Tolnaftate2004
Try maybe:
PHP Code:
temp.array = {{"Frankie","TSAdmin"},{2000,1500}};
temp.ind temp.array[0].index("Frankie");
echo(
temp.ind);
echo(
temp.array[1][temp.ind]); 
The way you're doing it will not work; you can loop through the elements to find the right index, like so:
PHP Code:
temp.array = {{"Frankie",2000},{"TSAdmin",1500}};
temp.temp.array.size();
for (
temp.i=0;temp.i<temp.l;temp.i++)
  if (
temp.array[temp.i][0] == "Frankie") {
    echo(
temp.i);
    break;
  }
echo(
temp.array[temp.i][1]); 
By my best estimates (read: guess), the former is ~2.5x faster.
__________________
◕‿‿◕ · pfa · check yer syntax! · src

Killa Be: when i got that locker in 6th grade the only thing in it was a picture of a midget useing a firehose :/
Reply With Quote