getting value from a javascript array and put it in php variable
<p>I use daterangepicker() to get two dates ( begginning and ending ), I'd like to put those dates in php variables.. i've succeeded to do an alert() to show those variables using a button.. but i don't know how to put them in the php. 
here's my code if anyone have an idea.. </p>

<hr>

<pre><code>&lt;script type="text/javascript"&gt;

$(function(){
    $('#rangeBa, #rangeBb').daterangepicker();
 });
function test(){
    var dates = new Array();
    dates[0] = document.inputdate.rangeBa.value;
    dates[1] = document.inputdate.rangeBb.value;
    return dates; 
}

&lt;/script&gt;

&lt;body&gt;
    &lt;form name="inputdate" method="post"&gt;
        &lt;input type="text" value="m/jj/aaaa" id="rangeBa" name="rangeBa"/&gt;
        &lt;input type="text" value="m/jj/aaaa" id="rangeBb" name="rangeBb"/&gt;
    &lt;/form&gt;
    &lt;button onclick="alert(test())"&gt;Click on this button&lt;/button&gt;

&lt;/body&gt;
</code></pre>
