Welcome Guest, Not a member yet? Register   Sign In
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS
#73

[eluser]sshz[/eluser]
[quote author="Too Pixel" date="1241463493"]This is probably neater and should work also with all chars (at least all latin chars) :

Code:
function url_title($str, $separator = 'dash')
    {
        $separator = ($separator == 'underscore') ? '_' : '-';
        $str = strtolower(htmlentities($str, ENT_COMPAT, 'UTF-8'));
        $str = preg_replace('/&(.)(acute|cedil|circ|grave|ring|tilde|uml);/', "$1", $str);
        $str = preg_replace('/([^a-z0-9]+)/', $separator, html_entity_decode($str, ENT_COMPAT, 'UTF-8'));
        $str = trim($str, $separator);
        return $str;
    }
[/quote]

That is neat, but doesn't support non-english characters or at least cyrillic, this makes News module with non-english titles mostly unusable.


Messages In This Thread
PyroCMS v0.9.7.4 - an open-source modular general purpose CMS - by El Forum - 05-04-2009, 09:24 AM



Theme © iAndrew 2016 - Forum software by © MyBB