A simple way to do it is by using explode() . You may have to play with it a bit though since you have to figure out if the line is a login/logout, the times, find patterns, etc.
Ex.
$mystring ="[Login] PHPSessionID=6568008f767a4d046adb427b0fb33c13, ID= 1, Username= mykg4orce, Time= Thu Aug 22 18:27:31 EDT 2002";
$parts = explode(" ", $mystring);
This will parse the string, putting every part that's separated by a space into an array.
Then you would use a foreach() to itterate through the array.