This article mainly introduces the PHP custom extension to get the function, combined with the instance form to analyze the PHP interception operation for file extension implementation skills, the need for friends can refer to the following
Specific as follows:
<?php$url = "http://www.abc.com/abc/de/fg.php?id=1";//This is the function GetUrl ($url) { $date = explode ('? '), $url ); $date = basename ($date [0]); $date = Explode ('. ', $date); return $date [1];} Var_dump (GETURL ($url));//The following two are web-based function Getext ($url) { $arr = Parse_url ($url); $file = basename ($arr [' path ']); $ext = Explode (".", $file); return $ext [1];} Var_dump (Getext ($url)), function GetName ($url) { $w _param = PathInfo ($url); $str = $w _param[' extension '); List ($type, $vars) = Explode ('? ', $str); return $type;} Echo ' Start3 '. Date ("y-m-d h:i:s");
The above is the whole content of this article, I hope that everyone's study has helped.