<?php
$tipo = $_POST["radatenua"];
if ($tipo > 0) {
if ($tipo == 40) {
$atenuantes = $_POST["atenuantes"];
foreach ($atenuantes as $at):
$atenuante1 .= $at . "-";
endforeach;
}
elseif ($tipo == 41) {
$agravantes = $_POST["agravantes"];
foreach ($agravantes as $ag):
$agravante1 .= $at;
endforeach;
}
}
?>
I have this code where depending on a radiobutton
it makes a certain saved in the database, it is a system that is not mine, therefore there is an error in the database, and then they ask me to save the different extenuating or aggravating in a certain field, that is, you should save something like this: 1-2, 7-8, 1-1. because then a specific code cuts that array
.
How could I modify my code to keep it that way?
Currently keeps them as follows: 56 78 1011