April 2, 2011
How to find whether a json array is empty or not?
Question by hbase_user
How to find whether a json array is empty or not using PHP?
empty($jsonarray) seems doesn’t work!
Answer by Starx
Try this
if(count(json_decode($jsonarray,1))==0) {
echo "empty";
}
//or
if(empty(json_decode($jsonarray,1))) {
echo "empty";
}