Creating Arrays with Short Syntax in PHP, Short Syntax Ordered Array Creation Short Syntax Array PHP

In this PHP Coding walkthrough we take a look at Creating Arrays with Short Syntax in PHP, Short Syntax Ordered Array Creation, and Short Syntax Array explained in PHP. This video is based on Codecademy’s Learn PHP course, we are in the “Ordered Arrays” section, and the lesson is “Creating Arrays with Short Syntax”. In the past lesson, we learned how to create an array using PHP. This required us to use the array keyword. While that was a valid way of creating an array, in this lesson we learn a shorter more conventional way of creating a PHP array. This way requires us to use opening and closing square brackets ( [ ] ) We first declare our array name, followed by the assignment operator ( = ). Then we enclose the data we want to store within opening and closing square brackets. Each piece of data within the square brackets must be separated by commas. Learning how to create arrays using short syntax is very helpful and is used by many developers. Learning to create ordered arrays using this syntax will make you more well-rounded as a PHP developer. Make sure to practice creating ordered arrays with short syntax as well as with long syntax to get used to both of them in case you encounter either on a project. Thanks for watching Creating Arrays with Short Syntax in PHP, Short Syntax Ordered Array Creation Short Syntax Array PHP.