PHP get the file suffix name function _php Tutorial

Source: Internet
Author: User
It seems that PHP does not come with the function to get the suffix name of the file, the book has not been found, the web search has not, wrote a function, it is easy to get. See online A lot of friends are looking, send to share, if you find a better way, be sure to leave a message to tell me!

The functions are as follows:

function Gontenfile ($FILESTR) {
$gonten = Explode ('. ', $filestr); Separating file names into arrays with dot numbers
$gonten = Array_reverse ($gonten); Reverse the above array
return $gonten [0]; Returns the first value of a reversed array
}

with $filename = gontenfile (' filename '); This way, you can get the suffix of the file.

This article from: www.Gonten.com

http://www.bkjia.com/PHPjc/364406.html www.bkjia.com true http://www.bkjia.com/PHPjc/364406.html techarticle It seems that PHP does not come with the function to get the suffix name of the file, the book has not been found, the web search has not, wrote a function, it is easy to get. See many friends on the internet looking for ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.