14.03.2016, 16:08
You can reverse the iterator and it's always good to check if the string is not null before comparing it with another string.
PHP код:
CheckServerIp(string[])
{
foreach(new i : Reverse(VirtualServer))
{
if (!isnull(VirtualServerInfo[i][sIP]) && !strcmp(VirtualServerInfo[i][sIP], string)) return i;
}
return -1;
}