This article provides nine php methods for getting file suffixes for your reference. The specific content is as follows: php *** CreatedbyPhpStorm. * User: liuft * Date: 201637 * Time: 15: 46 * First functionget_extension ($ file) {$ fileexplode (., $ file); returnend ($
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 ($
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.