Hi,
ich möchte einen Datei-Extender aus einem String entfernen:
$title="Cats & Dogs.TS";
$ext = ".TS";
$title = preg_replace($ext, "", $title);Ergebnis:
$title = "C & Dogs"
Dazu in diesem Fall reguläre Ausdrücke zu nehmen, ist unsinnig.
Nutze str_replace.
Der Extender ist dann zwar weg, aber ich find' einfach net die Maskierung um dem dammischen "." das Platzhalterdasein zu entreißen!
http://www.php.net/manual/de/regexp.reference.backslash.php
MfG ChrisB
--
The most exciting phrase to hear in science, the one that heralds new discoveries, is not “Eureka!” but “That's funny...” [Isaac Asimov]
The most exciting phrase to hear in science, the one that heralds new discoveries, is not “Eureka!” but “That's funny...” [Isaac Asimov]