Hello. There was a small problem with the adoption of POST data when transferring them to a PHP script via the ajax method.
The bottom line is that I want to receive all the data from the json data table, which is transmitted through the script. There are a lot of variables, so typing each into a php file is not an option like this:
$variable = $_POST["variable"]; The construction above works and the script does everything properly. I decided to use the foreach loop to process the $ _POST data array, but for some reason it does not accept data:
foreach ($_POST as $key => $val) { $key = $val; } Could you tell me how best to accomplish the task and why the foreach in this case does not accept the data?
$key = $val? remove it. In terms of your above,$_POST['varibale']when iterating withforaech$keywill take the value of the key string'variable', and$valwill become$_POST['variable']. - teran$key=$valwithprint_r([$key, $val])- teran