note 63308 added to function.htmlspecialchars
| From: | systemlard at gmail dot com | Date: | Sun, 19 Mar 2006 04:59:23 +0000 |
| Subject: | note 63308 added to function.htmlspecialchars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-106067@lists.php.net to get a copy of this message | ||
Aquà un error presentado en un foro español:
if($enviar) {
include("config.php") ;
function quitar($texto) {
$texto = trim($texto) ;
$texto = htmlspecialchars($texto) ;
$texto = str_replace(chr(160),'',$texto) ;
return $texto ;
}
Veamos:
trim() = Elimina espacios en blanco (u otros caracteres) del principio y final de una cadena.
htmlspecialchars() = Convierte caracteres especiales a entidades HTML.
str_replace() = Sustituye todas las apariciones de una cadena en otra.
chr() = Devuelve un carácter especÃfico.
¿Cual es?
Por si no te das cuenta te dejo el código:
if($enviar) {
include("config.php") ;
function quitar($texto) {
$texto = trim($texto) ;
$texto = str_replace(chr(160),'',$texto) ;
return $texto ;
}
----
Server IP: 201.216.232.3
Probable Submitter: 201.250.97.111
----
X-Spam-Status: Yes, hits=7.4 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER,
HEAD_ILLEGAL_CHARS autolearn=no version=2.64
----
Manual Page -- http://www.php.net/manual/en/function.htmlspecialchars.php
Edit -- http://master.php.net/note/edit/63308
Del: integrated -- http://master.php.net/note/delete/63308/integrated
Del: useless -- http://master.php.net/note/delete/63308/useless
Del: bad code -- http://master.php.net/note/delete/63308/bad+code
Del: spam -- http://master.php.net/note/delete/63308/spam
Del: non-english -- http://master.php.net/note/delete/63308/non-english
Del: in docs -- http://master.php.net/note/delete/63308/in+docs
Del: other reasons-- http://master.php.net/note/delete/63308
Reject -- http://master.php.net/note/reject/63308
Search -- http://master.php.net/manage/user-notes.php