If you just need to check if there are ANY elements in the array
if (empty($playerlist)) {
// list is empty.
}
If you need to clean out empty values before checking (generally done to prevent explodeing weird strings):
foreach ($playerlist as $key => $value) {
if (empty($value)) {
unset($playerlist[$key]);
}
}
if (empty($playerlist)) {
//empty array
}
An empty array is falsey in PHP, so you don’t even need to use empty() as others have suggested.