>I have a line which strips the suffix (gif, GIF, TIFF, jpg, JPEG, etcetc >or I would just use basename() :-) from a string but it seems needlessly >drawn out: > > $file = preg_split('/\./',$dirfiles[0]) ; $file = $file[0] ; > >I would like to just assign the 0th element of the preg_split() output to >my variable. I've also had to use a temp array for stat() output in >other places.
try: $file = reset(preg_split('/\./',$dirfiles[0])); --------------------------------------------------------------------- michal migurski- contact info and pgp key: sf/ca http://mike.teczno.com/contact.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php