Bien, lo que sucede es que tengo un Blog en Blogger, y como sabrán este no acepta emoticonos, por lo que hice un script aparte para colocar el texto de las entradas y este automaticamente me "convierta" los emoticonos.
El código funciona y todo, pero el problema es que me agrega una diagonal invertida "\" antes de las comillas que hubiese puesto en el formulario.
Es decir, que si en el texto que quiero convertir pongo algo como:
Hola mi nombre es Alan, y uso "comillas"
Al convertir el texto sale como:
Hola mi nombre es Alan, y uso \"comillas\"
Supongo que ya saben de lo que estoy hablando, sé que esas barras las pone como precaución el programa, pero no se si hay manera de evitarlo. El código que estoy usando es:
Código PHP:
<html>
<head>
<title></title>
</head>
<body>
<center>
<form action="convertir.php" method="post">
<p>Introduce el texto a convertir</p>
<textarea name="entrada" cols="80" rows="12"></textarea><br />
<input type="submit" name="Submit" value="Enviar" />
</form>
<p>Texto transformado:</p>
<textarea cols="80" rows="12">
<?php
if ($_POST["entrada"]){
$entrada=$_POST["entrada"];
$bbcode = array(
':admiracion:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/admiracion.gif" alt="" />',
':confundido:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/confundido.gif" alt="" />',
':ojosarriba:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/ojosarriba.gif" alt="" />',
':what:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/what.gif" alt="" />',
':interrogativo:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/interrogativo.gif" alt="" />',
':lentes:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/lentes.gif" alt="" />',
':bravo:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/bravo.gif" alt="" />',
':lloron:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/lloron.gif" alt="" />',
':estupefacto:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/estupefacto.gif" alt="" />',
':fuck:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/fuck.gif" alt="" />',
':trovador:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/trovador.gif" alt="" />',
':risa:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/risa.gif" alt="" />',
':enamorado:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/enamorado.gif" alt="" />',
':enfadado:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/enfadado.gif" alt="" />',
':nothingtosay:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/nothingtosay.gif" alt="" />',
':estrellado:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/estrellado.gif" alt="" />',
':llorando:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/llorando.gif" alt="" />',
':aguitado:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/aguidado.gif" alt="" />',
':bajoestima:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/bajoestima.gif" alt="" />',
':mafioso:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/mafioso.gif" alt="" />',
':arnold:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/arnold.gif" alt="" />',
':silbando:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/silbando.gif" alt="" />',
':1lugar:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/1lugar.gif" alt="" />',
':2lugar:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/2lugar.gif" alt="" />',
':3lugar:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/3lugar.gif" alt="" />',
':migrana:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/migrana.gif" alt="" />',
':XD:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/XD.gif" alt="" />',
':xX:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/xX.gif" alt="" />',
':wink:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/wink.gif" alt="" />',
':ohmy:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/ohmy.gif" alt="" />',
':lengua:' => '<img src="http://www.myimagehub.com/files/5684/albums/emoticonos/tongue.gif" alt="" />',
);
function transformarBB($texto){
$search=array_keys($GLOBALS['bbcode']);
$texto=str_replace($search, $GLOBALS['bbcode'], $texto);
return $texto;
}
$entrada = transformarBB($entrada);
echo $entrada;
}
?>
</textarea>
</center>
</body>
</html>
Muchas gracias de antemano
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)