1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00
Files
archived-web-php/include/posttohost.inc
Andreas Möller d9bcfed482 Enhancement: Enable array_syntax fixer
Co-authored-by: MathiasReker <mathias@reker.dk>

Closes GH-659.
2022-08-22 18:59:14 +02:00

23 lines
497 B
PHP

<?php
/*
This code is used to post data to the central server which
can store the data in database and/or mail notices or requests
to PHP.net stuff and servers
*/
function posttohost($url, $data)
{
$data = http_build_query($data);
$opts = [
'method' => 'POST',
'header' => 'Content-type: application/x-www-form-urlencoded',
'content' => $data,
];
$ctx = stream_context_create(['http' => $opts]);
return file_get_contents($url, false, $ctx);
}