您可以使用PHP的cURL库来向URL使用POST方法提交字符串。以下是一个示例代码:

<?php
$url = 'http://example.com/submit'; // 替换为您要提交的URL

$data = '{"data":[{"user_id":2,"u":11111,"d":11111111},{"user_id":3,"u":22222,"d":222222}]}'; // 要提交的字符串

$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($ch);
curl_close($ch);

echo $response;
?>

请将$url替换为您要提交的URL,然后运行上述代码即可将字符串通过POST方法提交到该URL。

php 向url用POST的方法提交如下字符串datauser_id2u11111d11111111user_id3u22222d222222

原文地址: https://www.cveoy.top/t/topic/iIqJ 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录