![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 10 Pomógł: 0 Dołączył: 25.12.2007 Ostrzeżenie: (0%) ![]() ![]() |
mam taka funkcje do zmiany tytulu danego artykulu na PERMALINKA. Czyli jesli jest tytuł "Zośka poszła spać" to zmmienia na zoska-poszla-spac. Problem tkwi w tym, że nie wiem jak zmienić litery ęśąć itp na esac itp . $result = preg_replace('/ś/', ' s', $result); nnie działa;/
public function getStrippedTitle() { $result = strtolower($this->getTitle()); // strip all non word chars $result = preg_replace('/\W/', ' ', $result); // replace all white space sections with a dash $result = preg_replace('/\ +/', '-', $result); // trim dashes $result = preg_replace('/\-$/', '', $result); $result = preg_replace('/^\-/', '', $result); return $result; }
Powód edycji: dodałem tag (cysiaczek)
|
|
|
![]() ![]() |
![]() |
Aktualny czas: 15.10.2025 - 11:42 |