hi
i would like to know how the output differs becos of bracket usage..wt s the main usage of bracket
<?
$arr = array(‘fruit’ => ‘apple’, ‘veggie’ => ‘carrot’);
print $arr[‘fruit’]; // apple
print $arr[‘veggie’]; // carrot
<br>
<?
print $arr[fruit]; // apple
?><br><hr>
<?
define(‘fruit’, ‘veggie’);
// Notice the difference now
print $arr[‘fruit’]; // apple
?>
<br>
<?
print $arr[fruit]; // carrot
?>
<br>
<?
print “Hello $arr[fruit]”; // Hello apple
?><br>
<?
print “Hello {$arr[fruit]}”; // Hello carrot–[B]clarification needed here
?>
<br>
<?
print “Hello $arr[fruit]”; // Hello apple
?>
<br><hr>
<?
// Concatenation is another option
print “Hello ” . $arr[‘fruit’]; // Hello apple
?>