Dave's Brain

Browse - Programming Tips - How do you append a element to the end of a PHP array?

Date: 2009nov26
Language: php


Q.  How do you append a element to the end of a PHP array?

A.  Assign to [] like this:

$a = array(); $a[] = 1; $a[] = 2; $a[] = 3;

Add a comment

Sign in to add a comment
Copyright © 2008-2017, dave - Code samples on Dave's Brain is licensed under the Creative Commons Attribution 2.5 License. However other material, including English text has all rights reserved.