We / / will assign value 'veggie' to a constant named fruit. define('fruit' ,'veggie'); / / Notice the difference now print $arr['fruit']; / / apple print $arr[fruit]; / / carrot / / The following is okay as it's inside a string.
Then, how is it possible that $foo[ bar] works?