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
Release: 2023-03-03 09:40:02
Original
1343 people have browsed it

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>
Copy after login

<code class="php">pathinfo($fname, PATHINFO_EXTENSION);</code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template