I created a jQuery array of objects:
my_family = [
person {
name = “nick”,
age = 41,
role = “dad”
},
person {
name = “john”,
age = 4,
role = “son”
},
person {
name = “sarah”,
age = 31,
role = “mom”
},
]
I am trying to post this to the same page via post as a php array, which I have done successfully :
$.post("http://www.samepage.com", {my_family: my_family});
I then want to use this data, but when I try to add it to a variable or manipulate it in any way the page is not responding. when I use the following code, I can see it in my firebug as printed into the html, but I can not add it to variables or anything, how come? this is what I use to see it in html:
print_r ($_POST['my_family']);
furthermore it doesnt print to the page with the name "my_family" but just "Array". My main goal is to loop though the array and store each "age" value into a new array. is what Im doing possible via the post method?
“ ”curly quotes really part of your code? if so, that will break your code. Use regular quotes"var".