Ver Mensaje Individual
  #2 (permalink)  
Antiguo 20/04/2011, 08:23
Hidek1
Colaborador
 
Fecha de Ingreso: octubre-2009
Ubicación: Tokyo - Japan !
Mensajes: 3.867
Antigüedad: 17 años
Puntos: 334
Respuesta: Función que funciona diferente según el entorno

Para evitar eso.. podrias usar entidades HTML para tus textos seo..
yo porlomenos tengo mi class de esta forma.

Código PHP:
class Khaus_Uri_Seo
{
    static public function 
removeAccents($string)
    {
        
$html = get_html_translation_table(HTML_ENTITIES);
        
$html = array_slice($html, 32, -4);
        foreach (
$html as $char => $entitie) {
            
$bar[] = substr($entitie, 1, 1);
        }
        
$string = htmlentities($string);
        
$string = str_replace($html, $bar, $string);
        return 
$string;
    }
    static public function 
safeName($string)
    {
        
$string = self::removeAccents($string);
        
$string = strtolower($string);
        
$string = preg_replace('/(&[a-z0-9]+;|[^a-z0-9_])/', '_', $string);
        
$string = preg_replace('/[\s_]+/', '_', $string);
        
$string = trim($string, '_');
        return 
$string;
    }
} 

saludos.