array(), 'warn' => array(), 'error' => array() ); function info($message) { $this->messages['info'][] = $message; } function warn($message) { $this->messages['warn'][] = $message; } function error($message) { $this->messages['error'][] = $message; } function display_messages() { foreach ($this->messages as $type => $messages) { if (!empty($messages)) { echo '
' . $message . '
'; } echo '