I know in PHP you can echo variables with double-quotes, but if I try to echo a multidimensional array, it doesn't work. Like...
echo "Here's my variable: $array[0][name]";
And that outputs : "Array[name]"
Is there a way to print its value without closing the quotes?
Answer
Is there a way to print its value without closing the quotes?
Yes, using Complex (curly) syntax:
echo "Here's my variable: {$array[0]['name']}";
No comments:
Post a Comment