<?php
function isValidApiResponse()
{
$url = "https://p...content-available-to-author-only...r.com/api/v1/affiliate/getBasicDetails";
$data = [
"MobileNo" => "nGyulSschikrQE6kR+uVkg=="
];
$headers = [
"Content-Type: application/json",
"Cookie: _abck=E24418EF155538F18D3DA91536273672~-1~YAAQ7AVaaKb8E/6RAQAAZQ0xBAzqAdu763o4eslwcV+vvNLwg4URhKTyMMNvpHwB2TL5mMTszCS2gAKofhgygfDS12eWVpZvU+ROaB9QjYNgEstkaSX6YQcpvcdSfm8vzEIzwGdsTFx1cSr6oMj4BkCD9S0aZVfPeqqJTWeDnnEJ2szsr+Qtw9+fEl0q9/AnoqB3QqUUeriDB6e6bfPUG/qY1Dux7S1XZtpT4zIvcgTpgpg9NG6L9WgQzZEWZ3pzb35g1MdbCLQtiXAAT30mEO2g7aSTQcbJRMS2qthsfbg3XTlp0ZL+pjc9BFREcBG3s1xgGYtGdO1tm3pP5IKTcSon3iaeQFlxnqd539ykt3MHWjpdOYa4FZyscHEG7a7dRYW8/h8dis4Mit/U3pNJZVD6~-1~-1~-1"
];
// Initialize cURL session
// Set cURL options
// Execute the request and capture the response
// Check for cURL errors
if ($response === false) {
return false;
}
// Close cURL session
// Decode the JSON response
// Validate response data
if (
isset($responseData['error'], $responseData['data']) && $responseData['error'] === false &&
count($responseData['data']) > 0 ) {
return true;
} else {
return false;
}
}
// Call the function and display the result
$result = isValidApiResponse();
echo $result ? 'true' : 'false';
PD9waHAKCmZ1bmN0aW9uIGlzVmFsaWRBcGlSZXNwb25zZSgpCnsKICAgICR1cmwgPSAiaHR0cHM6Ly9wLi4uY29udGVudC1hdmFpbGFibGUtdG8tYXV0aG9yLW9ubHkuLi5yLmNvbS9hcGkvdjEvYWZmaWxpYXRlL2dldEJhc2ljRGV0YWlscyI7CgogICAgJGRhdGEgPSBbCiAgICAgICAgIk1vYmlsZU5vIiA9PiAibkd5dWxTc2NoaWtyUUU2a1IrdVZrZz09IgogICAgXTsKCiAgICAkaGVhZGVycyA9IFsK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