如何通过 Javascript 脚本请求 PHP 页面并将数据传递给它?然后我如何让 PHP 脚本将数据传递回 Javascript 脚本?
客户端.js:
data = {tohex: 4919, sum: [1, 3, 5]};
// how would this script pass data to server.php and access the response?
服务器.php:
$tohex = ... ; // How would this be set to data.tohex?
$sum = ...; // How would this be set to data.sum?
// How would this be sent to client.js?
array(base_convert($tohex, 16), array_sum($sum))