Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Zmiękczenia w url
-4in1-
post
Post #1





Goście







Witam, czy wie ktoś jak zrobić aby URL zamiast
www.strona.pl/to-jest-mój-artykuł,
wyświetlał:
www.strona.pl/to-jest-moj-artkul ?

Fragment kodu skryptu
  1. function generate_seo_link($input,$replace = '-',$remove_words = true,$words_array = array() )
  2. {
  3. //make it lowercase, remove punctuation, remove multiple/leading/ending spaces
  4. $return = trim(ereg_replace(' +',' ',preg_replace('/[^a-zA-Z0-9\sążśźćęłóńĄŻŚŹĆĘŃÓŁ]/','',strtolower($input))));
  5.  
  6. //remove words, if not helpful to seo
  7. //i like my defaults list in remove_words(), so I wont pass that array
  8. if($remove_words) { $return = remove_words($return,$replace,$words_array); }
  9.  
  10. //convert the spaces to whatever the user wants
  11. //usually a dash or underscore..
  12. //...then return the value.
  13. return str_replace(' ',$replace,$return);
  14. }


Znalazłem podpowiedzi typu http://blog.poradnik-webmastera.com/57/skr...-krzaczki-w-url, jednak nie wiem jak to wprowadzić w ten skrypt...
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 22.08.2025 - 02:24