webguru2009
Mitglied
Das habe ich leider nicht.
Es wird wohl nicht gehen.
Es wird wohl nicht gehen.
Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature currently requires accessing the site using the built-in Safari browser.
oder werden sie schon mit ae geliefert?
<?php
$neu = "";
$text = "das Haus das keine Fenster hat ist dunkel, weil das licht nicht reinkommt und das ist ganz schön blöd!";
$anzahl = substr_count($text, "das");
if ($anzahl >= 3) {
$pos = preg_split("/das/", $text);
for ($a = 1; $a < count($pos); $a++) {
if ($neu == "") {
$neu = "das " .trim($pos[$a]);
} elseif ($neu != "" and ($a % 3) <> 0) {
$neu = $neu ." das " .trim($pos[$a]);
} elseif ($neu != "" and ($a % 3) == 0) {
$neu = $neu ." daß " .trim($pos[$a]);
}
}
}
echo $neu;
?>
das Haus das keine Fenster hat ist dunkel, weil daß licht nicht reinkommt und das ist ganz schön blöd!
SELECT
CONCAT(
@s := SUBSTRING_INDEX(str, from_str, count),
to_str,
SUBSTRING(str, LENGTH(from_str) + LENGTH(@s) +1 )
) AS new_string
FROM
(SELECT
'dass der die eine dass zum anderen dass hallo' AS str,
'dass' AS from_str,
'XX' AS to_str,
3 AS count
) AS vars
Mein 1. beitrag war falsch.
Es solle nicht in jeder 3. Zeile ersetzt werden sondern schon jeder 3. Wert.
Also ich habe einen Satz wo 6 mal ä darin vorkommt, dann soll es bei dem 3 und 6 Wert den
Umlaut ersetzen aber bei den anderen nicht.
SELECT
CONCAT(
@s := SUBSTRING_INDEX(str, from_str, count),
to_str,
SUBSTRING(str, LENGTH(from_str) + LENGTH(@s) +1 )
) AS new_string
FROM
(SELECT
'dass der die eine dass zum anderen dass hallo' AS str,
'dass' AS from_str,
'XX' AS to_str,
3 AS count
) AS vars