$CHAT_LINES) array_shift($data); break; } #### # III. Add the line at the end including the date. array_push( $data, sprintf( "[%s:%s] %s %s : %s", gmdate("H"), gmdate("i"), $_POST['firstname'], $_POST['lastname'], $_POST['message'] ) ); #### # IV. Now dump the array to the file. atomized_put_contents( "chat.log", implode( PHP_EOL, $data ) ); ?>