note 118867 added to splfileinfo.getbasename

From: Date: Fri, 19 Feb 2016 03:11:18 +0000
Subject: note 118867 added to splfileinfo.getbasename
Groups: php.notes 
Request: Send a blank email to php-notes+get-204987@lists.php.net to get a copy of this message
If you want to get only filename and dont want to use weird: <?php pathinfo($file->getBasename(), PATHINFO_FILENAME); ?> You can use (also weird but ~better looking): <?php $file->getBasename('.'.$file->getExtension()); ?> PS: Why there is getFilename ? when it returns ~same stuff as getBasename ? I have to do this ugly stuff^ instead of simple getFilename... ---- Server IP: 72.52.91.14 Probable Submitter: 78.102.39.130 ---- Manual Page -- http://php.net/manual/en/splfileinfo.getbasename.php Edit -- https://master.php.net/note/edit/118867 Del: integrated -- https://master.php.net/note/delete/118867/integrated Del: useless -- https://master.php.net/note/delete/118867/useless Del: bad code -- https://master.php.net/note/delete/118867/bad+code Del: spam -- https://master.php.net/note/delete/118867/spam Del: non-english -- https://master.php.net/note/delete/118867/non-english Del: in docs -- https://master.php.net/note/delete/118867/in+docs Del: other reasons-- https://master.php.net/note/delete/118867 Reject -- https://master.php.net/note/reject/118867 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#204987) next »