Hi Kai345!
Würde ich die Teile direkt bzw. mit "/" zusammensetzen, ginge das schief:
"foo" und "bar" ergibt "foobar" bzw. "foo/bar"
"foo/" und "bar" ergibt "foo/bar" bzw. "foo//bar"
"foo/" und "/bar" ergibt "foo//bar" bzw. "foo///bar"
"foo" und "/bar" ergibt "foo/bar" bzw. "foo//bar"Es soll immer "foo/bar" zurückgegeben werden.
trim ( $teil1, "/" );
trim ( $teil2, "/" );
$pfad = $teil1 . "/" . $teil2
Nur so eine Idee. Ergibt in jedem Fall "foo/bar".
mfG
Benjamin
--
For animals, the entire universe has been neatly divided into things to (a) mate with, (b) eat, (c) run away from, and (d) rocks.
For animals, the entire universe has been neatly divided into things to (a) mate with, (b) eat, (c) run away from, and (d) rocks.