// fetch POST routine
//
// exclude optcheck_wex_m0c7 - Tidal River Severn
//
$url = 'https://canalplan.uk/cgi-bin/api.cgi';
$opts = ['optcheck_wex_m0c7' => true];
$opts = 'optcheck_wex_m0c7';
$opts = ['wex' => 'm0c7'];
$opts = 'wex_mc07';
//$opts = '';
$data = ['mode' => 'plan', 'start' => $place1['id'], 'end' => $place2['id'] , 'pref' => $opts];
var_dump($data);
// use key 'http' even if you send the request to https://...
$options = [
'http' => [
'header' => \"Content-type: application/x-www-form-urlencoded\\r\\n\",
'method' => 'POST',
'content' => http_build_query($data),
],
];
$context = stream_context_create($options);
$result = file_get_contents($url, false, $context);
var_dump($result);