function curlStatusLatest($url) {
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, 'https://esanna.se/arabiska/' . $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_REFERER, 'https://arabic.fi');
$json = curl_exec($curl);
$response = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
if ($response == 200) {
return json_decode($json);
}
return null;
}
$words = curlStatusLatest("get_random.php?nr-words=$nrOfWords");
$words = htmlspecialchars($words->words);
echo "
";
$wordsAr = curlStatusLatest("get_random.php?words=$words&lang=ar");
$wordsAr = $wordsAr->words;
$wordsSv = curlStatusLatest("get_random.php?words=$words&lang=sv");
$wordsSv = $wordsSv->words;
$wordsEn = curlStatusLatest("get_random.php?words=$words");
$wordsEn = $wordsEn->words;
$wordsId = explode(',', $words);
echo '';
?>