Sie sind nicht angemeldet.

Lord-Diablo

unregistriert

1

Montag, 18. April 2011, 08:58

Freundliche Zeichenkette

Hallo forum,

ich wollte mal fragen. Ich habe probleme mich zeichen in url.

Wen ich neue seite mache, dan zeichnen wie ř,š,ů,á, usw sind ok, ale zeichen í ist imer da un ich weiss nicht wie ich es mache. Mein kod in config.inc.php seht so aus:

Zitat

// MAKE MY URL =>
// Wandelt einen String in eine URL freundliche Zeichenkette um
// makeMyURL($string);

function makeMyURL($wort) {

$wort = strtolower($wort);

$wort = str_replace("ß", "ss", $wort);
$wort = str_replace("!", "", $wort);
$wort = str_replace("#", "", $wort);
$wort = str_replace("?", "", $wort);
$wort = str_replace("'", "", $wort);
$wort = str_replace("$", "", $wort);
$wort = str_replace("%", "", $wort);
$wort = str_replace("*", "", $wort);
$wort = str_replace("~", "", $wort);
$wort = str_replace("§", "", $wort);
$wort = str_replace("(", "", $wort);
$wort = str_replace(")", "", $wort);
$wort = str_replace("´", "", $wort);
$wort = str_replace("`", "", $wort);
$wort = str_replace("˛", "", $wort);
$wort = str_replace("ł", "", $wort);
$wort = str_replace(".", "", $wort);
$wort = str_replace(",", "", $wort);
$wort = str_replace("^", "", $wort);
$wort = str_replace("°", "", $wort);
$wort = str_replace("<", "", $wort);
$wort = str_replace(">", "", $wort);
$wort = str_replace("|", "", $wort);
$wort = str_replace("[", "", $wort);
$wort = str_replace("]", "", $wort);
$wort = str_replace("{", "", $wort);
$wort = str_replace("}", "", $wort);
$wort = str_replace("=", "", $wort);
$wort = str_replace("\"", "", $wort);
$wort = str_replace("-", "-", $wort);
$wort = str_replace("+", "-", $wort);
$wort = str_replace("/", "", $wort);
$wort = str_replace("\\", "", $wort);
$wort = str_replace("&", "und", $wort);
$wort = str_replace("Ü", "ue", $wort);
$wort = str_replace("ü", "ue", $wort);
$wort = str_replace("Ä", "ae", $wort);
$wort = str_replace("ä", "ae", $wort);
$wort = str_replace("Ö", "oe", $wort);
$wort = str_replace("ö", "oe", $wort);
$wort = str_replace(" ", "-", $wort);
$wort = str_replace("í", "i", $wort);

return $wort;


Aber es hatte mit nicht geholfen, und dan noch ne frage, wo stehle ich die zeichne wie zum beispiel: news, download, usw....? Da werden alle zeichen angezeitg.
Danke

Dieser Beitrag wurde bereits 1 mal editiert, zuletzt von »Lord-Diablo« (23. April 2011, 02:09) aus folgendem Grund: Hilft mir bitte jemand?


Werbung

Lord-Diablo

unregistriert

2

Donnerstag, 28. April 2011, 14:54

:(

Allso keiner weisst es?

Werbung

3

Donnerstag, 28. April 2011, 19:56

Was funktioniert denn bei deinem geposteten Code denn nicht? Ich habe es lokal ausprobiert und es funktioniert.

<?php

function makeMyURL($wort) {
$wort = strtolower($wort);
$wort = str_replace(":", "::", $wort);
$wort = str_replace("í", "i", $wort);

return $wort;
}

$bla = "Das ist eine Zeichenkette mit diesen Buchstaben: ííííííí";
print makeMyURL($bla); //Ausgabe ist: "das ist eine zeichenkette mit diesen buchstaben:: iiiiiii"

?>

Werbung

Ähnliche Themen