Skip to content

Instantly share code, notes, and snippets.

@tohokuaiki
Created November 16, 2016 03:08
Show Gist options
  • Save tohokuaiki/edec2ba4875d55776f2359427b2ab38b to your computer and use it in GitHub Desktop.
Save tohokuaiki/edec2ba4875d55776f2359427b2ab38b to your computer and use it in GitHub Desktop.
PHPのpathinfoの仕様、変わりすぎぃ!!
<?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