Ver Mensaje Individual
  #4 (permalink)  
Antiguo 03/03/2013, 21:09
Avatar de zreep
zreep
 
Fecha de Ingreso: octubre-2009
Ubicación: Argentina
Mensajes: 534
Antigüedad: 14 años, 6 meses
Puntos: 12
Respuesta: problemas con la ñ y acento al ingresar a mi bd

Hace tiempo tenia el mismo problema y use una funcion llamada preg_replace y tube mas problemas...


Lo voy a compartir para todos... pasen la vos...

functions.php

Código PHP:
<?php

function setLinks($txt) {
 
$tex preg_replace('`(((f|ht){1}tp://)[-a-zA-Z0-9@:%_\+.~#?&amp;//=]+)`i''<a rel="external" href="\\1">\\1</a>'$txt);
$tex preg_replace('`([[:space:]()[{}])(www.[-a-zA-Z0-9@:%_\+.~#?&amp;//=]+)`i''\\1<a rel="external" href="http://\\2">\\2</a>'$tex);
$tex preg_replace('`([_\.0-9a-z-]+@([0-9a-z][0-9a-z-]+\.)+[a-z]{2,3})`i''<a rel="external" href="mailto:\\1">\\1</a>'$tex); 
 
return 
$tex;
}

?>
y cuando usen un while o algo para traer datos de la base...

Código PHP:
<?php
require 'functions.php';

while (
$fila.....){
$apu $fila['texto'];
?>

<?php echo setLinks($apu);?>

<?php
mysql_close();
?>

Bueno espero sirva... Saludos
__________________
Zreep