i am parsing a xml api using curl. the curl provides an array and i fetch it using foreach loop but most of the time i get array like below which is not fetched by foreach loop. the array is like below
array(
[0]=>
)
so how to check if the array is null so that the foreach has not to fetch the null array. i mean which (if()) condition should i use.
the another problem is that why curl gives empty array most of the time. what is the problem. i am working on localhost and the api is called from remote server. please help me.
empty()
ie
$test = “”;
if (empty($test))
{
echo “true”
}
would return true