I am trying to find out the key for value I know will apear in an array, but am unsure where.
I thought the best way to do this would be the array_search() function, but for some reason it doesn't seem to work.
the code is like this:
<?
$kill = file("killmail.txt");
$searchstr ="Destroyed items:";
$end_of_involved_parties = array_search($searchstr , $kill);
$end_of_involved_parties_key = $end_of_involved_parties-6;
$involded_parties = array_slice($kill,6,$end_of_involved_parties_key);
?>
now the array that its searching (or at least part of it) looks like this:
[22] => Destroyed items: [23] => [24] => Type: Small Shield Booster I (Fitted - Medium slot) [25] => [26] => Type: Standard Missile Launcher I (Fitted - High slot) [27] => [28] => Type: Standard Missile Launcher I (Fitted - High slot) [29] => [30] => Type: Sabretooth Light Missile I (Fitted - High slot) [31] => Quantity: 40
key 22 (in this case) has my search term as its value, but no matter how i try to work it array_search() doesn't find it and returns 0.
if any1 can point me in the right direction i would be greatful.. thx