Php can obtain the file suffix in nine ways ,. Php provides nine methods for obtaining file suffixes. This article provides nine methods for php to obtain file suffixes for your reference. the specific content is as follows: php *** CreatedbyPhpStorm. * User: 9 methods for php to obtain the file suffix,
This article provides nine php methods for getting file suffixes for your reference. the specific content is as follows:
<? Php/*** Created by PhpStorm. * User: liuft * Date: 2016/3/7 * Time: * // first // function get_extension ($ file) // {// $ file = explode ('. ', $ file); // return end ($ file); //} // second // function get_extension ($ file) // {// return substr (strrchr ($ file ,'. '), 1); // The third type // function get_extension ($ file) {// return pathinfo ($ file) ['extension']; //} // type 4 // function get_extension ($ file) // {// return subst R ($ file, strrpos ($ file ,'. ') + 1); // class 5 // function get_extension ($ file) // {// $ file = preg_split ('/\. /', $ file); // return end ($ file); // class 6 // function get_extension ($ file) {// $ file = strrev ($ file); // return strrev (substr ($ file, 0, strpos ($ file ,'. '); //} // class 7 // function get_extension ($ file) // {// return pathinfo ($ file, PATHINFO_EXTENSION ); //} // class 8 // function get_extension ($ file) // {// p Reg_match_all ('/\. [a-zA-Z0-9] +/', $ file, $ data); // return! Empty ($ data [0])? Substr (end ($ data [0]), 1): ''; //} // ninth // function get_extension ($ file) {// return str_replace ('. ', '', strrchr ($ file ,'. '); //} // think so much for the moment, and then add $ file =" http://10.31.63.8:8081/M00/00/09/Ch8_CFaaMLqAO87JAACePvS0ZRk.webp "; $ Data = get_extension ($ file); var_export ($ data );
The above is all the content of this article, hoping to help you learn.
Articles you may be interested in:
- Php code for changing all file suffixes in directories and subdirectories
- Php code for changing all file extension extensions in directories and subdirectories
- Function code for modifying file extensions in batches in php
- PHP obtains the three functions with the file suffix.
- Php method for modifying the specified file suffix
- Php code row to get the file suffix instance analysis
- PHP implements batch file suffix modification
- PHP provides several common methods to get the file suffix
Examples in this article share nine php methods for getting file suffixes for your reference. the specific content is as follows: php/*** Created by PhpStorm. * User :...