Hello Stack Overflow i hope you are well today;
So i am using jQuery to append a form with more input fields; The Session is storing the data as an Array for the key: Children.
I would like to know show the user the data in that array how would this be done?
jQuery that adds the input fields (some pages previous)
$('.children-main-add').click(function(){
var attrName = $(this).attr('name');
var count = $(this).attr('count');
$(this).attr('count', (parseInt(count)+1))
var input = $('<input />');
input.attr('type','text')
input.attr('name',attrName+"["+count+"]" )
$('.children-main').append($('<li />').append(input));
$('#content li').removeClass('alt');
$('#content li:odd').addClass('alt');
$(this).val('Add Another Child');
})
The data from the session : Key: children / Value: Array
If i was not clear on something please let me know !
I thank you in advance for your help
<?php if(isset($_SESSION['children'])) { echo $_SESSION['children']; } ?>print_r($_SESSION['children']);Can you show any example with data.print_rfor echoing arrays to the screen, and if it doesnt work usevar_dumpso we can better understand what the array holdsArray ( [0] => Julia Roberts [1] => Zaraki Akram [2] => Simon Evans Smith )