Question:Which of the following is correct way to use curly brace in the string? 

A $capicals=array("bangladesh"=>"Dhaka"); echo "This capital of Bangladesh is {$capitals["bangladesh"]}"; 

B $capicals=array("bangladesh"=>"Dhaka"); echo "This capital of Bangladesh is {{$capitals["bangladesh"]}}"; 

C $capicals=array("bangladesh"=>"Dhaka"); echo "This capital of Bangladesh is {$capitals['bangladesh']}"; 

D $capicals=array("bangladesh"=>"Dhaka"); echo "This capital of Bangladesh is {$capitals[bangladesh]}"; 

+ Answer  Moderated
+ Report
Total Preview: 931

Copyright © 2024. Powered by Intellect Software Ltd