1 (edited by zachera 2009-01-29 08:19)

Topic: Improvement to pun_linebreaks

Before:

//
// Convert \r\n and \r to \n
//
function pun_linebreaks($str)
{
    return str_replace("\r", "\n", str_replace("\r\n", "\n", $str));
}

After:

//
// Convert \r\n and \r to \n
//
function pun_linebreaks($str)
{
    return str_replace(array("\r\n", "\r"), "\n", $str);
}

Hope this helps. tongue

Edit: PHP 4.0.5 required to do the array(), so it might be a problem. hmm