Forum Moderators: coopster
$string=explode(',',$string);
if(empty($string)){
echo "empty";
}else{
echo "full";
}
This should echo empty but it echo's full, how can I check the array is empty?
Array ( [0] => [1] => [2] => [3] => )
Depending on what your are looking for there are a couple ways to check. I think it would be a good idea to validate each $string value.
<?php $str = ",,,,"; echo array_sum(explode(",",$str)); ?>
will echo 0