$ch = curl_init();
$data = array(['name'=>'John']);
$ch = curl_init('http://domian.local/post.php');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
curl_close($ch);
vardump($result);
echo $_POST["name"];
echo "ДОШЛО";
john
Дошло
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'http://mysite.ru/post.php');
curl_setopt($curl, CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, "name=john");
$out = curl_exec($curl);
echo $out;
curl_close($curl);
echo $_POST["name"];
echo "ДОШЛО";
die;