First of all:
array_days[] = "psdfo";
array_days[] = "bsdf";
These lines are valid PHP but not valid JavaScript. The correct equivalent would be:
array_days.push("psdfo");
array_days.push("bsdf");
On to passing the resulting array of strings (that's what I am assuming) to PHP. To send it as form data in pure JS, we can create hidden input elements when the form is submitted (try it):
<form id="myform" method="POST" action="http://www.cs.tut.fi/cgi-bin/run/~jkorpela/echo.cgi">
<input type="submit" value="Submit">
</form>
<script>
document.getElementById('myform').onsubmit = function() {
for(var i = 0; i < array_days.length; ++i) {
var inputElement = document.createElement('input');
inputElement.type = 'hidden';
inputElement.name = 'array_days[]';
inputElement.value = array_days[i];
this.appendChild(inputElement);
}
};
</script>
PHP will interpret each input having the name of array_days[] as an array element of $_POST['array_days']. For example, you can access $_POST['array_days'][0] in PHP.
For AJAX, jQuery 1.4 and above will automatically achieve this effect when you pass an array as a data parameter to $.ajax.
Why not json_decode()? The answer is that older versions of web browsers do not support the JavaScript function JSON.stringify() that is equivalent to PHP's json_encode(), although there is a library to add support. One might consider it for a more complex case, but for such a simple case, it should not be necessary.