preg_match kleines Problem
Simone
- php
Hi
Ich hab ein Problem:
Ist bestimmt nicht so schwer zu lösen aber ich bekomm's einfach nicht hin.
Also ich möchte aus $conttestfil nur den "suchfad" isolieren
Dateiname(wort) "logfile" bleibt immer gleich
$conttestfil= "c:\programme\apache group\apache\htdocs\opti\dateimanger\hauptfad\suchfad\logfile1.rww_";
Mein Lösungsansatz:
$mask = str_replace("\", "#", $conttestfil);
if (preg_match('/#([^"]+)#logfile/i', $mask,$suchwort))
$suchw .=$suchwort[1];
$suchw = str_replace("#", " ", $suchw);
echo " $suchw";
Simone
Also ich möchte aus $conttestfil nur den "suchfad" isolieren
Dateiname(wort) "logfile" bleibt immer gleich
dirname() ist Dein Freund: http://www.php.net/manual/de/function.dirname.php.
Gruß,
soenk.e
Hi soenk.e
erstmal danke!!!!
Geht aber nicht ich bekomme als Ausgabe von
$file1 = dirname ($conttestfil);
"c:\programme\apache group\apache\htdocs\opti\dateimanger\hauptfad\suchfad"
brauch aber nur "suchfad" ohne die restliche Verzeichnissausgabe
Simone
Ich hab's:
$conttestfil= "c:\programme\apache group\apache\htdocs\opti\dateimanger\hauptfad\suchfad\logfile1.rww_";
$mask = str_replace("\", "#", $conttestfil);
if (preg_match('/#([^#]+)#logfile/i', $mask,$suchwort))
$suchw .=$suchwort[1];
$suchw = str_replace("#", " ", $suchw);
echo "............. $suchw ................";
Simone