GENDER API PHP-LEGACY
function getGender($firstname) {
$myKey = 'insert your server key here';
$data = json_decode(file_get_contents(
'https://gender-api.com/get?key=' .
$myKey .
'&name=' . urlencode($firstname)));
return $data->gender;
}
echo getGender('markus'); //Output: male