How to check if the key of array is set or not in PHP
How do I tell the difference between the two?
$a = [
'a' => ['key' => 'value'],
['key' => 'value']
];
$a = [
'a' => ['key' => 'value'],
'0' => ['key' => 'value']
];
The difference is that the first one does not have an index number but the default is 0 (['key' => 'value']) but second has 0 index ('0' => ['key' => 'value'])
Note: It does not make sense to check whether the key is an array of numbers or not because the user may give the number.