Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Putting comma(,) at end of array.Is it a convention?

Tags:

arrays

php

Sometimes I see arrays like the following:


array('item1' => array(
         'subitem1',
         'subitem2',
      )

Why a comma is added at end of array wheras there is not any element after submitem2?

like image 439
Nick.h Avatar asked Oct 16 '10 19:10

Nick.h


1 Answers

It makes it easier to append another entry at a later point in time.

like image 134
Oliver Charlesworth Avatar answered Oct 12 '22 13:10

Oliver Charlesworth