public function p2br($data)
    {
        // Remove opening <p> tags
        $data = preg_replace('#<p[^>]*?>#', '', $data);

        // Remove trailing </p> to prevent it to be replaced with unneeded <br />
        $data = preg_replace('#</p>$#', '', $data);

        // Replace each end of paragraph with two <br />
        $data = str_replace('</p>', '<br /><br />', $data);

        return $data;
    }