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;
}
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment