Home  >  Article  >  Backend Development  >  A simple way to get '/' passed parameter in php

A simple way to get '/' passed parameter in php

小云云
小云云Original
2018-02-08 09:08:181498browse

By outputting $GLOBALS, you can see that the parameters after '/' exist in $_SERVER['PATH_INFO']; declare an array to obtain the parameters we pass after '/'. This article mainly brings you a A simple way to get the value of '/' passed parameter in PHP. The editor thinks it is quite good, so I will share it with you now and give it as a reference for everyone. Let’s follow the editor to take a look, I hope it can help everyone.


$arr = explode('/', $_SERVER['PATH_INFO']);

//print_r($arr)查看详细信息

Related recommendations:

php implements a function that can pass variable parameters

vue.js Implementation method of parent passing parameters to child components

Detailed explanation of js anonymous function usage and parameter passing examples


The above is the detailed content of A simple way to get '/' passed parameter in php. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn