foreach $ _POST [key] PHP

I need to insert keys into $_POST. Is there a way to reach this? I'm newer in PHP.

    $mat_list_data = '';

    foreach( $_POST['mat_tit'] as $key => $_POST['mat_tit'] ) {
      $mat_list_data .= '
        <table" cellspacing="1">
            <tr>
                <td>'.$_POST['mat_tit'].'</td>
            </tr>
            <tr>

/* from here */

            <td>'.$_POST['mat_up'].'</td>
            <td>'.$_POST['mat_q'].'</td>
            <td>'.$_POST['mat_ut'].'</td>
            <td>'.$_POST['mat_c'].'</td>
            <td>'.$_POST['mat_isum'].'</td>
            <td>'.$_POST['mat_vv'].'</td>
            <td>'.$_POST['mat_sv'].'</td>
            <td>'.$_POST['mat_itot'].'</td>

/* to here */

            </tr>
        </table>';
}

    $pdf->writeHTML($mat_list_data, true, true, false, true, 'L');

If theres an easier process, please tell me. Thanks a lot to any direction.

$_POST[] is a superglobal array, specifically one that references HTTP data that has been posted. For this reason adding data to the array will likely make your code more confusing and error prone, as it would not be posted information.

As with all the superglobals, you should treat them as special case sources of input data; Reading the data into local variables and then using correct sanitation.

For example:

$data = $_POST['matt_tit'];
$results = array();
foreach($data as $name => $value) {
  $results[$name] = $this->sanitiseData($value); // Filter input
}
// Now use $results rather than $_POST

You don't need to assign it's value to $_POST, you can use a simple array. I'm not sure if this is what you are looking for, but I'll give it a shot:

    $mat_list_data = '<table" cellspacing="1"><tr>';

    foreach( $_POST as $Values ) {
      $mat_list_data .= '<td>' . $Values . '</td>';
      }
    $mat_list_data .= '</tr></table>'