What would it be like to delete data in an array using input? All this with the session variable to have to make a hidden array so that when refreshing I don't delete it. I understand that it would be something like that, even though it's wrong since it doesn't work
if(isset($_POST['eliminar'])){
$verboESP = $_POST['verboESP'];
unset($verbosOculto[$_POST['verboESP']]);
$verbosOculto = array_values($verbosOculto);
header('Location: diccionario.php');
}
with the input
<input type="text" name="verboESP">
<input type="submit" name="eliminar">
Unfortunately the code you shared in the previous question is missing (you deleted the question) to solve this question.
You keep insisting on working with a local variable,
$verbosOculto
, instead of working with$_SESSION['verbosOculto']
.You should do: