Chodzi o konwersję tytułu artykułu/strony na url (tak jak w prezentowanym na php.pl artykule) - problem w tym, że jeśli tytuł staje się url-em - to nie może zawierać masy różnych znaków innych niż podstawowe 30.
Próbowałem to robić tak:
Kod
$link = html_entity_decode($link);
$link = strip_tags($link);
$link = ereg_replace('|', '_', $title);
$link = ereg_replace('#', '_', $title);
$link = ereg_replace('@', '_', $title);
$link = ereg_replace('\', '_', $title);
$link = ereg_replace('/', '_', $title);
$link = ereg_replace('-', '_', $link);
$link = ereg_replace(' ', '_', $link);
$link = strip_tags($link);
$link = ereg_replace('|', '_', $title);
$link = ereg_replace('#', '_', $title);
$link = ereg_replace('@', '_', $title);
$link = ereg_replace('\', '_', $title);
$link = ereg_replace('/', '_', $title);
$link = ereg_replace('-', '_', $link);
$link = ereg_replace(' ', '_', $link);
ale chyba nie tędy droga.
Pozostaje jeszcze zamiana polskich znaków narodowych na "bezogonkowe" i generalnie eliminacja wszelakich znaków poza standartowymi 30-toma.
Więc generalnie może prostsza i szybsza byłaby jakaś funkcja - eleminująca wszystkie znaki oprócz tych 30-tu.
Czy ktoś mógłyby mi coś podpowiedzieć?
Z góry dziękuje na pomoc.