slug

function _slug( $str = null ){ $characters = array( "Á" => "A", "Ç" => "c", "É" => "e", "Í" => "i", "Ñ" => "n", "Ó" => "o", "Ú" => "u", "á" => "a", "ç" => "c", "é" => "e", "í" => "i", "ñ" => "n", "ó" => "o", "ú" => "u", "à" => "a", "è" => "e", "ì" => "i", "ò" => "o", "ù" => "u", "¿" => "", "?" => "" , "," => "", "¡" => "", "!" => "", "'" => "" ); $str = trim(str_replace(' ', '-', $str)); $str = strtr($str, $characters); return strtolower($str); }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.