I have seen source code like:
$something = $sql['value']
I have searched a lot about it and I found that it's from arrays. But I didn’t understand the exact meaning.
For example,
$people = [
'Susan' => [
'Age' => 24,
'Phone' => '555-123-4567'
],
'Jack' => [
'Age' => 27,
'Phone' => '555-9876-5432'
]
];
echo $people['Jack']['Age']; // 27
Can we write code like the following?
if(!empty($people)
$something = $people['a value']
I just need to know how we can declare a variable and give a value in square brackets.