Autor Zpráva
VASEK
Profil *
Zdravim, prosim o radu:

mam formular <textarea></textarea>

a kdyz v tomto formulari vlozim radek [ENTER] tak se do databaze ulozi tak jak jsem zadal.

a v tom je problem, potreboval bych tento [ENTER] odstranit pred ulozenim do DB.

je to nejak mozny? prosim o radu, dekuji.

Vasek
Mireczech
Profil
string strtr ( string $str, string $from, string $to )
string strtr ( string $str, array $replace_pairs )

kde znak noveho radku je ' '
VASEK
Profil *
Tak jsem zkousel vsechy tyhle moznosti a nic:


$string = strtr ($string, "# #", "xxx");

$string = strtr ($string, " ", "xxx");

$string = strtr ($string, "
", "xxx");



???????
VASEK
Profil *
OPRAVA

Tak jsem zkousel vsechy tyhle moznosti a nic:


$string = strtr ($string, "# #", "xxx");

$string = strtr ($string, " ", "xxx");

$string = strtr ($string, "
", "xxx");



???????
VASEK
Profil *
tak jeste jednou

Tak jsem zkousel vsechy tyhle moznosti a nic:


$string = strtr ($string, "#zpetne lomitko a n#", "xxx");

$string = strtr ($string, "zpetne lomitko a n", "xxx");

$string = strtr ($string, "
", "xxx");



???????
dracek
Profil
$string = str_replace (" ", "", $string);
VASEK
Profil *
nejde...

nejde ani str_replace

zkousel jsem i toto:

$string = Str_Replace(" ","@@", $string);

a vysledek:

text text text
@@
@@ text text text.
Mireczech
Profil
FUNGUJE (overeno)

<?
$str="asdfsa da s fas d
asdfasdfasd
asdfasd fasd asd
asd fasd fa dssa fas
asdf asdf asdf asdf
asd fads fa dsfa ds
";

echo nl2br($str);
echo "<hr>";
$nl="
"; // tady je n (bez mezery)
echo nl2br(strtr($str,$nl,' '));
?>


Vaše odpověď

Mohlo by se hodit


Prosím používejte diakritiku a interpunkci.

Ochrana proti spamu. Napište prosím číslo dvě-sta čtyřicet-sedm:

0