Using ajax to call php and return multiple variables?

后端 未结 5 836
既然无缘
既然无缘 2021-02-04 22:30

I am trying to use javascript to call a php script which then will return multiple variables back to my javascript so I can manipulate them.

This is my JS.



        
5条回答
  •  伪装坚强ぢ
    2021-02-04 23:08

    you can simply return it like that return ['num1'=>$num1,'num2' => $num2];

    and also, you can access it as followed, respone.num1

提交回复
热议问题