Home >Backend Development >PHP Tutorial >javascript - Qiniu obtains the suffix name before uploading the image, how to obtain it

javascript - Qiniu obtains the suffix name before uploading the image, how to obtain it

WBOY
WBOYOriginal
2016-12-05 13:44:181351browse

houzhui in the picture is a custom function, used to get the image suffix name, but it is useless. When it is passed to Qiniu, the image name will not be displayed directly
It will only display the date up to $name plus a random number. Does anyone know? How to get the picture suffix

javascript - Qiniu obtains the suffix name before uploading the image, how to obtain it

Reply content:

houzhui in the picture is a custom function, used to get the image suffix name, but it is useless. When it is passed to Qiniu, the image name will not be displayed directly
It will only display the date up to $name plus a random number. Does anyone know? How to get the picture suffix

javascript - Qiniu obtains the suffix name before uploading the image, how to obtain it

houzhui('$(fname)') Is there a typo here?
That should be it.

<code>$fname = "/path/test.png";
echo houzhui("$fname");
function houzhui($file) 
{ 
    return pathinfo($file, PATHINFO_EXTENSION); 
} </code>

<code class="php">pathinfo($fname, PATHINFO_EXTENSION);</code>
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn