I want to write a function in javascript which will call the Getfilename.php and Get the $filesArray that is return in javascript.
GetFilenme.php is another file and
At the end, do this:
print json_encode($filesArray);
and it will send back a json object, which Javascript can read easily.