note 105484 deleted from function.array-push by danbrown

From: Date: Mon, 22 Aug 2011 14:02:47 +0000
Subject: note 105484 deleted from function.array-push by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182642@lists.php.net to get a copy of this message
Note Submitter: maxtor dot mustermann at gmail dot com ---- This example show other ways of adding elements to the end of an array other than array_push() <?php $fruits = array("orange", "banana"); // array_push($array, $var); array_push($fruits, "mango", "cherry"); // $array[] = $var $fruits[] = "apple"; $fruits[] = "raspberry"; // $array[] .= $var $fruits[] .= "pineapple"; $fruits[] .= "avocado"; // output print_r($fruits); ?> // output Array ( [0] => orange [1] => banana [2] => mango [3] => cherry [4] => apple [5] => raspberry [6] => pineapple [7] => avocado )

« previous php.notes (#182642) next »