I have this function:
function api()
{
$date = time()- 86400;
$method = "getOrders";
$methodParams = '{
"date_confirmed_from": $date,
"get_unconfirmed_orders": false
}';
$apiParams = [
"method" => $method,
"parameters" => $methodParams
];
$curl = curl_init("https://api.domain.com");
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, ["X-BLToken:xxx"]);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($apiParams));
$response = curl_exec($curl);
return $response;
}
I want to put on line 8 variable date and I have tried {$date}
$date
'.$date.'
".$date."
every time I get error from api
If I put value manually like 1589972726 it working, but I need to get value from $date variable!
Thank you!