15.10.2017, 00:36
What is your array?
It depends what do you need exactly, like if it's a vehicle model id array and you wanted to locate Infernus (Model ID: 411) index in the array, this is our array and this is how we're doing it:
It depends what do you need exactly, like if it's a vehicle model id array and you wanted to locate Infernus (Model ID: 411) index in the array, this is our array and this is how we're doing it:
PHP код:
new aModels[] = {400, 521, 532, 452, 411, 529, 521};
for(new i = 0; i < sizeof aModels; i++)
{
if(aModels[i] == 411)
{
// Now variable "i" is our index
printf("The index is: %i", i); // (It's 4, according to our aModels array)
break;
}
}