Thanks for the help can't figure this out...
I have a multidimensional array on football statistics. I need to search the array for a specific team, and return that teams key (which row the teams statistics are in).
for ($r = 0; $r<32; $r++) {
if (in_array('Pittsburgh Steelers', $offense[$r][1])) {
$off_needle = $r;
}
}
This doesn't work, but is the syntax I came up with. I already know theres 32 rows in the array, so I have an iteration for 31. The name of the team is in the second column, or key 1 in the array, so I search by [r$][1].
This error is: Wrong datatype for second argument
Is there a simple solution to this? Thanks...