quote:
Originally posted by ipab
sounds good. Problem is I feel that we are getting ahead of ourselves here . I cant seem to figure out a mass port for the logs into the db.
hmm..
* -dt- opens Vim and tries to parse them with preg_match....
edit: done it
code:
$x = file_get_contents('./chatlog.txt');
//this regexp matches the body of the text (the part where you talk )
$match = "/\.-{68}\.(?:.+)\.-{68}(.+)-{68}\./smUx";
//this regexp matches the header (part with dates n stuff)
$head = "/\.-{68}\.(.+)\.-{68}/smUx";
preg_match_all($match,$x,$data);
preg_match_all($head,$x,$header);
//show the first header
echo $header[1][0];
//show the first body
echo $data[1][0];
btw those regexp's are no where near pefect