se volessi sostituire il carattere \ con niente, come si fa???Codice PHP:
$stringa=str_replace("\","",$stringa);
![]()
se volessi sostituire il carattere \ con niente, come si fa???Codice PHP:
$stringa=str_replace("\","",$stringa);
![]()
Ultima modifica di Alhazred; 05-06-2014 a 16:14
isak
perché \ è un carattere speciale, quindi devi farne l'escape.Codice PHP:
$stringa=str_replace("\\","",$stringa);
E' esattamente quello che fa il codice che hai postato, a parte il fatto che essendo la \ un carattere di escape che normalmente si usa com \n o \r, va scirtta come doppia: \\
$stringa=str_replace("\\","",$stringa);
"Le uniche cose che sbagli sono quelle che non provi a fare."
Atipica
Abbiamo risposto in stereo!![]()
"Le uniche cose che sbagli sono quelle che non provi a fare."
Atipica