note 31957 modified in function.array by vrana

From: Date: Tue, 17 Aug 2004 13:56:47 +0000
Subject: note 31957 modified in function.array by vrana
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-79883@lists.php.net to get a copy of this message
Similarly to a comment by stlawson at sbcglobal dot net on this page: http://www.php.net/basic-syntax.instruction-separation It is usually advisable to define your arrays like this: $array = array( 'foo', 'bar', ); Note the comma after the last element - this is perfectly legal. Moreover, it's best to add that last comma so that when you add new elements to the array, you don't have to worry about adding a comma after what used to be the last element. <?php $array = array( 'foo', 'bar', 'baz', ); ?> --was-- Similarly to a comment by stlawson at sbcglobal dot net on this page: http://www.php.net/basic-syntax.instruction-separation It is usually advisable to define your arrays like this: $array = array( 'foo', 'bar', ); Note the comma after the last element - this is perfectly legal. Moreover, it's best to add that last comma so that when you add new elements to the array, you don't have to worry about adding a comma after what used to be the last element. $array = array( 'foo', 'bar', 'baz', ); http://php.net/manual/en/function.array.php

« previous php.notes (#79883) next »