Call php from javascript and return an array from php to Javascript function

后端 未结 9 1613
孤街浪徒
孤街浪徒 2020-12-03 13:22

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

9条回答
  •  Happy的楠姐
    2020-12-03 13:49

    At the end, do this:

    print json_encode($filesArray);
    

    and it will send back a json object, which Javascript can read easily.

提交回复
热议问题