salve a tutti prima di salvare in un database i dati provenienti da una textarea eseguo le seguenti operazioni
$testo = trim(stringa_db($_POST['testo']));
$testo = angolari($testo);
$testo = nl2br($testo);
le due funzioni che richiamo sono le seguenti
function stringa_db ($value)
{
global $conn;
$value = (get_magic_quotes_gpc()) ? stripslashes($value) : $value;
return mysqli_real_escape_string($conn,$value);
}
function angolari($variabile){
$var = str_replace("<", "<", $variabile);
$var = str_replace(">", ">", $variabile);
return $var;
}
ho notato che stampando a video i dati le parentesi angolari sono presenti ... in teoria non avrei dovuto trovare < e > ?
inoltre gli acapo non vengono riportati