Home  >  Article  >  Backend Development  >  What should I do if php cannot receive the parameters of the applet?

What should I do if php cannot receive the parameters of the applet?

藏色散人
藏色散人Original
2021-12-09 10:54:202340browse

Solution to the problem that php cannot receive the parameters of the mini program: 1. Open the corresponding PHP code file; 2. Convert json into an array through "json_decode($menu,true);" for normal data processing .

What should I do if php cannot receive the parameters of the applet?

#The operating environment of this article: Windows 7 system, PHP version 7.4, Dell G3 computer.

What should I do if php cannot receive the parameters of the mini program?

What is the reason why PHP cannot receive the POST parameters of the WeChat applet?

php obtains the information as follows:

$menu = file_get_contents('php://input');
$val = json_decode($menu,true);
echo($val['menu']);

After converting json into an array, you can process the data normally!

Recommended learning: "PHP Video Tutorial"

The above is the detailed content of What should I do if php cannot receive the parameters of the applet?. 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