Kay: str_replace() funzt net

Beitrag lesen

Hi mabu,

wie wär's mit: $variable = str_replace("%0D%0A","<br>\n",$variable);
du gehst hierbei aber davon aus, dass der Zeilenumbruch kodiert wurde. sicherheitshabler würde ich auch folgende replaces anwenden:
$variable = str_replace(chr(13).chr(10),"<br>\n",$variable);
$variable = str_replace(chr(13),"<br>\n",$variable);
$variable = str_replace(chr(10),"<br>\n",$variable);

allerdings gibt's da ja auch die Funktion nl2br(), vielleicht gefällt die dir besser:
$variable = nl2br($variable);

MdG, Kay