예제 #1
0
 public static function getUrlImage($str)
 {
     //removendo os acentos
     $str = trim($str);
     $str = Filters::remove_accents($str);
     //trocando espaço em branco por underline
     $str = eregi_replace('( )', '_', $str);
     //tirando outros caracteres invalidos
     $str = eregi_replace('[^a-z0-9\\_]', '', $str);
     //trocando duplo,tripo,quadrupo... espaço (underline) por 1 underline só
     $str = eregi_replace('[\\_]{2,}', '', $str);
     return strtolower($str);
 }