note 29701 added to function.basename

From: Date: Sat, 22 Feb 2003 00:21:28 +0000
Subject: note 29701 added to function.basename
Groups: php.notes 
Request: Send a blank email to php-notes+get-44333@lists.php.net to get a copy of this message
to answer the lots of dots problem: $path = "/blah/file.name.has.lots.of.dots.ext"; $extension = array_pop(explode('.', basename($path))); $therest = substr(basename($path), 0,"-" . (strlen($extension) + 1)); print "EXTENSION: $extension<br>"; print "THE REST: $therest"; --Christopher Maujean -- http://www.php.net/manual/en/function.basename.php http://master.php.net/manage/user-notes.php?action=edit+29701 http://master.php.net/manage/user-notes.php?action=delete+29701 http://master.php.net/manage/user-notes.php?action=reject+29701

« previous php.notes (#44333) next »