What is the function to use in PHP to list all variables passed via POST?

To list all variables passed via POST in PHP, you can use the $_POST superglobal array. This array contains all the variables sent to the current script via the HTTP POST method. You can loop through this array to access and display the values of all POST variables.

// Loop through the $_POST superglobal array to list all variables passed via POST
foreach ($_POST as $key => $value) {
    echo $key . ' = ' . $value . '<br>';
}