Hi i got this code:
It replaces ahref url to something like hello-my-name-is.PHP Code:function removedata2($str, $a=false)
{
$str = ereg_replace("[^A-Za-z0-9]", "-", $str);
$str = str_replace("'","", $str);
$str = str_replace("&","&", $str);
$str = strip_tags($str, '');
if ($a==true && strlen($str)>=1000000){
$str=substr($str, 0, 1000000)."..";
}
return $str;
}
But my code got weird bug with ereg_replace.
That it makes: hello---my-name---is-
So sometimes it does -- and sometimes one -
Looks like he replaces every char expect AZ az 09
Is there way to do this nicer? And cleaner.
So i get nice url title with single - in it?








Bookmarks