> i'd like to split Benutzer_CRA.php > to get CRA but sometimes the files are called > Benutzer_OVE_CRA.php and therefore the result schould OVE_CRA > how cann i tell preg_split to split the string at the > first occurence of _ and before .php
preg_match("/_(.*)\.php/",$str,$matches); $matches[1] will contain what you're looking for. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php