Can someone tell me how to create an array $custom_interval of key value pairs of days and hours:
custom_interval[[Mon][0 1 2 3 4 5 6 7]]
custom_interval[[Tue][0 1 2 3 4 5 6 7]]
So that in PHP, I should be able to say
$hours = $custom_interval[$day];
The code that I have written gives me
[object Object]
This is the code:
//create a 2 dimentional array of days and time intervals and assign it to hidden input form element.
for(var i=0; i<uniquedayArray.length; i++) {
innerArray.push(uniquedayArray[i]);
for(j=0;j<timeArray.length; j++){
outerArray[innerArray] = timeArray[j];
}
}
alert(outerArray);
Can someone tell me what am I doing wrong? Thanks
console.log(outerArray);
instead ofalert()
console.log
and you should be able to find out more.