This example describes the PHP custom extension fetch function. Share to everyone for your reference, specific as follows:
<?php
$url = "http://www.abc.com/abc/de/fg.php?id=1";
This is written by myself.
function GetUrl ($url) {
$date = explode ('? ', $url);
$date = basename ($date [0]);
$date = Explode ('. ', $date);
return $date [1];
}
Var_dump (GETURL ($url));
The following two are made online
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");
More about PHP Interested readers can view the site topics: "PHP commonly used functions and skills summary", "PHP object-oriented Program Design Introductory Course", "PHP Mathematical Arithmetic Skills summary", "PHP Array" operation Skills Encyclopedia, "PHP Data structure and algorithm tutorial", " PHP Programming algorithm Summary, "PHP Regular Expression Usage summary" and "PHP common database Operation skill Summary"
I hope this article will help you with the PHP program design.