What is the correct syntax for assigning values to an array in PHP?

When assigning values to an array in PHP, you can use the array() function or the shorthand square bracket syntax. The shorthand square bracket syntax is more commonly used and allows you to directly assign values to an array without using the array() function. To assign values to an array using the shorthand square bracket syntax, you simply specify the values separated by commas within square brackets.

// Using the shorthand square bracket syntax to assign values to an array
$myArray = ['value1', 'value2', 'value3'];