gpt4 book ai didi

php - 如何将数据从 Javascript 传递到 PHP,反之亦然?

转载 作者:可可西里 更新时间:2023-10-31 22:05:41 25 4
gpt4 key购买 nike

<分区>

如何让 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))

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com