PHP view newlines & tabs in string

View a string's newlines and tabs in PHP.

function raw($str) {
    $str = str_replace(array("\t", "\r\n", "\r", "\n"),
                     array('\t', '\r\n', '\r', '\n'), $str);
    return $str;
}

Comments

Leave a Reply