I use curl with the Riot API. Everything is working fine on my live server but isn't in local. The curl extension is enabled in WampServer and I don't get any error messages, it's just a blank page.
Here's my code even if it's not actually relevant.
<?php
$private_key = "XXX";
function summoner_name($summoner, $server, $private_key) {
$summoner_encoded = rawurlencode($summoner);
$summoner_lower = strtolower($summoner_encoded);
$curl_url = 'https://' . $server . '.api.pvp.net/api/lol/' . $server . '/v1.4/summoner/by-name/' . $summoner . '?api_key='.$private_key;
$curl = curl_init($curl_url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$result = curl_exec($curl);
curl_close($curl);
return $result;
}
function summoner_info_array_name($summoner) {
$summoner_lower = mb_strtolower($summoner, 'UTF-8');
$summoner_nospaces = str_replace(' ', '', $summoner_lower);
return $summoner_nospaces;
}
$summoner = "Test";
$server = "euw";
$summoner_info = summoner_name($summoner, $server, $private_key);
$summoner_info_array = json_decode($summoner_info, true);
$summoner_info_array_name = summoner_info_array_name($summoner);
$summoner_id = $summoner_info_array[$summoner_info_array_name]['id'];
$summoner_name_display = $summoner_info_array[$summoner_info_array_name]['name'];
$summoner_icon = $summoner_info_array[$summoner_info_array_name]['profileIconId'];
echo '<img src="http://ddragon.leagueoflegends.com/cdn/6.9.1/img/profileicon/'.$summoner_icon.'.png" /><br/><hr>'.$summoner_name_display;
?>
And here's my phpinfo()
for curl extension.
Thanks in advance!
.