Вопрос

I am protecting my string using this code to insert it into the database:

function protect($string){

    $string = mysql_real_escape_string($string);

    return $string;
}

I then unprotect it using this code so that I can echo it out from the database:

function echoprotect($string){

    $string = nl2br($string);
    $string = stripslashes($string);

    return $string;
}

The nl2br doesn't seem to work and I don't know why. The output I get is:

HellornrnThe content ect...

instead of:

hello

the content ect...

Нет правильного решения

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top