$arr = ['fruit' => 'apple', 'veggie' => 'carrot']; // Способ 1. echo "Hello {$arr['fruit']}"; // Способ 2. echo "Hello $arr[fruit]"; Do constants always do not work inside strings?
$arr = ['fruit' => 'apple', 'veggie' => 'carrot']; // Способ 1. echo "Hello {$arr['fruit']}"; // Способ 2. echo "Hello $arr[fruit]"; Do constants always do not work inside strings?
Source: https://ru.stackoverflow.com/questions/683215/
All Articles