This results in a parse error. echo "A banana is $fruits['banana'] ."; / / Works echo "A banana is". $fruits['banana']. "."; / / Works echo "This square is $square - width meters broad ."; / / Won't work.
$fruits = array( 'strawberry '= 'red', 'banana' = 'yellow'); / / note that this works differently outside string-quotes echo "A banana is $fruits[banana] ."; echo "This square is $square - width meters broad ."; / / Won 't work.