PHP How to get the file extension _php tutorial

Source: Internet
Author: User
There are a number of ways to get the suffix of a file, as described below.

 
  

The Strtolower () function converts a string to lowercase.

The Strrev () function reverses the string.

The Strpos () function returns the position of the first occurrence of a string in another string.

is to first find the symbol '. ' , and then calculates the length of the extension. The length of the total length of the string minus the extension length is used to calculate how long to intercept.

http://www.bkjia.com/PHPjc/752561.html www.bkjia.com true http://www.bkjia.com/PHPjc/752561.html techarticle There are a number of ways to get the suffix of a file, as described below. Php$file_name = "Bkjia.txt"; Echo get_exname ($file _name);/** * Get file extension * @param unknown_ Ty ...

  • 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.