Last active
June 18, 2023 19:27
-
-
Save ktquez/cf2add45c1bbd153ed6f to your computer and use it in GitHub Desktop.
session_form_simple.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
session_start(); // inicia a sessão | |
if(isset($_SESSION['form'])){ | |
$_SESSION['form'] = array_merge($_SESSION['form'], filter_input_array(INPUT_POST)); // se existir, ele unifica os arrays | |
}else{ | |
$_SESSION['form'] = filter_input_array(INPUT_POST); // se não existir, ele inicializa | |
} | |
var_dump($_SESSION['form']); // dá uma saída de como está ficando o array na session (serve somente de exemplo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment