File "test.php"
Full path: /www/sonar/test.php
File size: 590 B
MIME-type: text/x-php
Charset: utf-8
<?php
$data = array(
'test1'=>'aaa',
'test2'=> array(
array(
'test3'=>'bbb'
)
),
'test4'=> array(
array(
'test5'=>'ccc',
'test6'=>'ddd'
)
)
);
$data_json = json_encode($data);
$ch = curl_init();
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data_json);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_URL, 'https://penta-02.ptgw.net/sonar/recv.php');
$result=curl_exec($ch);
echo 'RETURN:'.$result;
curl_close($ch);
?>