I simply wrote a PHP processing URL normal mode variable pathinfo mode function

Source: Internet
Author: User

/**
* @category Url_type This method is to handle the URL pattern pathinfo mode
*/
function Url_type () {
URL mode Controller--acquisition of methods
$url = $_server[' php_self '). " <br> ";
echo $url, "<br/>";
$num =strpos ("$url", '. php ') +5;
$data = Mb_substr ($url, $num);
$array _url= Explode ("/", $data);
echo "<pre>";
Var_dump ($array _url);
echo "</pre>";
$_get[' C '] = $array _url[0];
$_get[' m '] = $array _url[1];
Fetching of URL pattern parameters
Unset ($array _url[0]);
Unset ($array _url[1]);
Var_dump ($array _url);d ie ();
$nums = count ($array _url);
if ($nums!=0) {//means there are parameters
if ($nums%2 ==0) {
$nums = $nums/2;
for ($i =1; $i <= $nums; $i + +) {
$_get[$array _url[2* $i]] = strip_tags ($array _url[2* $i +1]);
}
}else
Die ("Pro, there is a problem with your parameter settings, please check your link address!") ");
}
}

I simply wrote a PHP processing URL normal mode variable pathinfo mode function

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.