I got a "Fatal error: Call to undefined function: json_encode()" on my php file which is hosted on an ovh server. Here is the code:
function get_paypload_giftcard($partnerId, $gcRequestId, $currencyCode, $gcAmount)
{
$amount = trim($gcAmount);
$payload = array(
"creationRequestId" => $gcRequestId,
"partnerId" => $partnerId,
"value" =>
array(
"currencyCode" => $currencyCode,
"amount" => floatval($amount)
)
);
return json_encode($payload);
}
How to solve the problem? Is there any other alternative than json_encode?