im trying to get perm link witht his function:
// Generates Permalink
function gen_permalink($title)
{
$permalink=string_limit_words($title, 9);
if(!mb_check_encoding($permalink,"UTF-8"))
{
$permalink=preg_replace("/[^a-z0-9\s]/i", "", $permalink);
$permalink=trim(preg_replace("/\s\s+/", " ", $permalink));
$permalink=strtolower(str_replace(" ","-",$permalink));
}
else
{
$permalink=trim($title);
$permalink=str_replace(" ","-",$permalink);
}
$final = $permalink;
$count = 1;
while(already_exists($final))
{
$final = $permalink . "-" . $count;
$count++;
}
return $final;
but i cant menaged to do that..
Out put from
!its's SO funny! Blockquote
is
!its's-SO-funny!
Im trying to get
itss-so-funny