What is the difference between accessing array elements using round brackets versus square brackets in PHP?

In PHP, when accessing array elements, round brackets are used for functions, while square brackets are used for accessing array elements by key. To access array elements using square brackets, you need to specify the key of the element you want to retrieve. Using round brackets to access array elements will result in a syntax error.

// Using square brackets to access array elements
$array = ['a' => 1, 'b' => 2, 'c' => 3];
echo $array['b']; // Outputs 2