Home > Backend Development > PHP Tutorial > powerquest partitionmagic php uses post and get in a concise way

powerquest partitionmagic php uses post and get in a concise way

WBOY
Release: 2016-07-29 08:42:28
Original
1015 people have browsed it

Recently I saw a clever method, the principle is
$var_a ='var_b';
$$var_a ='test';
Then echo $var_b; is 'test'
So it can be handled like this

Copy code The code is as follows:


foreach(array('_COOKIE', '_POST', '_GET') as $_request)
{
  foreach($$_request as $_key => $_value)
 {
  $_key{0 } != '_' && $$_key = addslashes($_value);
  }
}


Like test.php?name=name_in&pwd=pwd_in
You can directly use $name, $pwd
to reference the customer data sent by the end.
Note: The variables sent by the customer are filtered here using addslashes().

The above introduces a concise way of using post and get in powerquest partitionmagic php, including the content of powerquest partitionmagic. I hope it will be helpful to friends who are interested in PHP tutorials.

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template