Dave's Brain

Browse - programming tips - php append to an 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;
What this info useful to you? You can donate to say thanks

Add a comment

Sign in to add a comment
Copyright © 2008-2010, 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.