Created
November 16, 2016 03:08
-
-
Save tohokuaiki/edec2ba4875d55776f2359427b2ab38b to your computer and use it in GitHub Desktop.
PHPのpathinfoの仕様、変わりすぎぃ!!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function pathinfo($f) | |
{ | |
$ret = pathinfo($f); | |
if (!isset($ret['filename'])){ | |
$filename = substr($f, strrpos($f, '/') + 1); | |
$filename = substr($filename, 0, strrpos($filename, '.'.$ret['extension'])); | |
$ret['filename'] = $filename; | |
} | |
return $ret; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment