English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
La funzione addcslashes() viene utilizzata per interpretare una stringa utilizzando backslash.
string addcslashes ( string $str )
Restituisce una stringa, nella quale sono stati aggiunti backslash prima di alcuni caratteri per necessità di query SQL e altro. Questi caratteri sono virgolette singole ('), virgolette doppie ("), backslash (\) e NUL (carattere NULL).
Prima di PHP 5.4, il comando magico magic_quotes_gpc era impostato su on, di fatto tutti i dati GET, POST e COOKIE erano stati interpretati con addcslashes(). Non utilizzare addcslashes() su stringhe già interpretate da magic_quotes_gpc, poiché ciò causerebbe un'interpretazione doppiata. In questi casi, è possibile utilizzare la funzione get_magic_quotes_gpc() per verificare.
Restituisce la stringa interpretata
Numero di sequenza | Parametri e descrizione |
---|---|
1 | str Stringa da interpretare |
Prova il seguente esempio
<?php $str = "Is your name sai Right?"; echo addcslashes($str); ?>