@Immutable
    public static String nl2br(String string, boolean isXhtml) {
        String br = "<br />";

        if (!isXhtml) {
            br = "<br>";
        }
        return string.replaceAll("(\\r?\\n)", br + "$1");
    }
Parses the cslashes bitmap returning an actual bitmap.

@param charset the bitmap string

@return the actual bitmap
exts/jphp-zend-ext/src/main/java/org/develnext/jphp/zend/ext/standard/StringFunctions.java