3

I am new to PHP and have read a tutorial where I did not understand something in the code:

What does it mean when $names = []; is in a PHP script?

MC Emperor
  • 22,334
  • 15
  • 80
  • 130
Shoruna
  • 53
  • 1
  • 5

1 Answers1

5

Its the same as array(). This syntax is valid since PHP 5.4.

$array = [1, 2, 3, 4];
Havenard
  • 27,022
  • 5
  • 36
  • 62