function getCat( $we_docID, $rootdir ) { global $DB_WE; // webEdition Datenbank-Verbindung $Categories = f( "SELECT Category FROM tblFile WHERE ID='" . $we_docID . "'", "Category", $DB_WE ); //IDs aller Kategorien für das übergebene Objekt auslesen $Cats = array(); $Cats = explode( ",", $Categories ); // String in Array-Elemente teilen $Cats = array_slice( $Cats, 1, -1 ); // führendes und letztes Komma entfernen foreach( $Cats as $Value ) // für jeden Array-Eintrag Werte ausgeben { $Path = f( "SELECT Path FROM tblCategorys WHERE ID='$Value'", "Path", $DB_WE ); // Pfad & Name der Kategorie $pos = strpos( $Path, $rootdir ); if( $pos !== false) // Root-Verzeichnis gefunden return $Path; } }