pathinfo

Make PHP pathinfo() return the correct filename if the filename is UTF-8

故事扮演 提交于 2019-11-26 21:06:43
问题 When using PHP's pathinfo() function on a filename known to be UTF-8, it does not return the correct value, unless there are 'normal' characters in front of the special character. Examples: pathinfo('aä.pdf') returns: Array ( [dirname] => [the dir] [basename] => aä.pdf [extension] => pdf [filename] => aä ) which is fine and dandy, but pathinfo('äa.pdf') returns: Array ( [dirname] => [the dir] [basename] => a.pdf [extension] => pdf [filename] => a ) Which is not quite what I was expecting.

What exactly is PATH_INFO in PHP?

江枫思渺然 提交于 2019-11-26 18:51:59
all external URLs look like 'module/action?key1=param1'. No customization possible--but it's fast. The difference is that the first uses PHP's GET, and the second uses PATH_INFO. I've seen PATH_INFO several times, but still don't know what exactly it is. What does it do? Andrew Moore Actually, PATH_INFO is related to the Apache Web Server serving PHP pages and not PHP per se. PATH_INFO is an environment variable set by Apache when the AcceptPathInfo directive is turned on. It will contain trailing pathname information that follows an actual filename or non-existent file in an existing