Here is my code,
//I have set formData array to session array here
$_SESSION['form_data'] = $formData = array();
//here i have set a value to formData array
$formData[0] = 'insert data done';
//I want to accually echo the value of formData[0] - key's value
$var = $_SESSION['form_data'][$formData[0]];
var_dump($var);
I'm new to php and my requirement here is to build a form validation and send the validation data back to the form. So I use the session to send data to one php file to another. I think that's the only way I can send data from one page to another.