can anyone explain why I can’t see what’s inside the array? I think it supposed to be able to have multiple numbers (subscriptions) so maybe that’s why I’m having trouble? Here’s the code.
$num = $_SESSION['subscription_ids'];
if(is_array($num))
{
print_r($num);
}
else
{
echo "not an array";
}
//Thanks DonnieM, yet It's spliting out "Array ( ) " no joke.
What is going on?
Your confusion apparently arises from the output of
1foris_array.is_arrayreturns a boolean value (trueorfalse). When outputting boolean values as text,trueis represented as1andfalseas nothing (an empty string).Therefore
1just means yes, this is an array. It does not tell you how many elements there are in the array.