I am looking for a function that suits the following situation.
What the script does: It retrieves the server.log from a minecraft server, and breaks it into sections from user chats, to server notifications etc.
I have an array containing the users information, it is set by another file called users.yml and it is converted to an array like so
$userconfig = array(
'TruDan' => array(
'prefix' => '&3',
'suffix' => '&e',
),
'TruGaming' => array(
'prefix' => '&c',
'suffix' => '&f',
),
'PancakeMiner' => array(
'prefix' => '&c',
'suffix' => '&f',
),
'Teddybear952' => array(
'prefix' => '&b',
'suffix' => '&f',
),
);
What i want to do, is search the $line from server.log (it loops through lines) for a username above (array key) and return the array. so i can then parse $ret['prefix'] and $ret['suffix']
mc.php (the file) http://pastebin.com/9geyfuup server.log (partial, the actual thing is 12,000 lines long, so i took a few lines from it) http://pastebin.com/DKz8YfgK