I am retrieving some data from a table in mysql. The values are stored with a | separater
Example:
test 1|test 2|test 4
and so on..
Everything works great except when there are blank entries in the column. I am using the following code.
$groups = explode('|', $row['groups']);
if(count($groups) >0)
{
echo 'There are values';
}else{
echo 'No values';
}
The problem I have is this returns 'There are values' even if the column is empty.
Any help would be great appreciated.
Best Answer
explode
The issue is that your returned array contains a single element that is empty string.