In php, how can I get the value corresponding to the variable name?

Source: Internet
Author: User
In php, how does one obtain the value corresponding to the variable name? & Lt ;? Php & nbsp; $ result = $ row ['result']; & nbsp; $ pid = $ row ['pid ']; & nbsp; & How does nbs obtain the value whose name is the corresponding variable in php?
$ Result = $ row ['result'];
$ Pid = $ row ['pid'];
If ($ result = 'conformances ')
{
Echo" ";
Echo" Does not match ";
Echo" Not involved ";
}
If ($ result = 'nonconformity ')
{

Echo" ";
Echo" Does not match ";
Echo" Not involved ";

}
If ($ result = 'not involved ')
{

Echo" ";
Echo" Does not match ";
Echo" Not involved ";

}
If ($ result = '')
{
Echo" ";
Echo" Does not match ";
Echo" Not involved ";
}

?>
How can I obtain the value of the value corresponding to the "name = '$ pid'" submitted by post on another page?
Another page $ a =$ _ POST ['$ pid']; it must be incorrect. how can this problem be obtained? This "name" must be replaced by a variable. Otherwise, the single-choice function may be faulty. please help me. thank you!

------ Solution --------------------
After the submission, print_r ($ _ POST); knows how to obtain it.
------ Solution --------------------





------ Solution --------------------
Reference:
After the submission, print_r ($ _ POST); knows how to obtain it.

+ 1

------ Solution --------------------
Reference:
PHP code? 1234

The name I mentioned cannot be the name of the result constant. the name should be replaced by a variable.

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.