I have a problem regarding on how to get the value of the array variable passed by .post in jquery into my php page
this is my jquery code:
minDate = [];
hoursWork = [];
empId = [];
$('.minDate').each(function() {
minDate.push($(this).val());
});
$('.hoursWork').each(function() {
hoursWork.push($(this).val());
});
$('.empId').each(function() {
empId.push($(this).val());
});
$.post('rtInsert.php', { minDate: minDate, hoursWork: hoursWork, empId: empId }, function(data) {
alert(data);
});
How can I get the passed data in my rtInsert.php
i tried
$minDate = $_POST['minDate'];
$empId = $_POST['empId'];
$workHours = $_POST['hoursWork'];
now how will i get the individual value of the array because all the 3 variables is an array
All I know is a single array using foreach() but
what if there are 3 arrays passed
Is there any idea how I can get it or how can I passed into single array.
Thanks in Advance.
$_POST['blah'], tryfile_get_contents("php://input")