ich habe ein (kleines) Problem:
Bsp.:
Code: Alles auswählen
<?
$text="Uwe ist toll und cool";
$text=preg_replace("'\w* ist toll'", "", $text);
echo "$text";
?>
-> damit wird Uwe ist toll gelöscht und nur "und cool" ausgegeben.
Aber jetzt kommt das Problem:
Code: Alles auswählen
<?
$text="Bären sind toll und cool";
$text=preg_replace("'\w* sind toll'", "", $text);
echo "$text";
?>
"Bä und cool"
Ich will unbedingt auch im ersten Wort vor "sind toll" auch Worte erfassen, die Umlaute enthalten.
Hat jemand eine Idee?