Home > Backend Development > PHP Tutorial > Get file extension function

Get file extension function

WBOY
Release: 2016-07-25 09:09:29
Original
1088 people have browsed it
Usage: echo FileExtension("name.txt"); get txt
  1. function FileExtension($fstr){
  2. $retval = '';
  3. $pt = strrpos($fstr, ".");
  4. if ($pt) $retval = substr($fstr, $pt+1 , strlen($fstr) - $pt);
  5. return ($retval);
  6. }
Copy code


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