I know I can use an array value in double quotation. Like this:
<?php echo "my name is: $arr[name]"; ?>
But when I use Multidimensional array, I can`t see my result:
<?php echo "he is $twoDimArr[family][1]"; ?>
Here, the output is: he is Array[1]
What`s the reason?
And I know I can use my code like this:
<?php echo "he is ".$twoDimArr[family][1]; ?>
But I don't want this.
You should enclose more complicated structures in curly braces:
echo "he is {$twoDimArr['family'][1]}";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With