Tuesday, August 2, 2011

Php Array types

Array is a datatype in php...

It is mostly used to store multiple item under a single variable name.

Types of array in PHP:

1.Numeric or Index array.
2.Associative array.
3.Multi-dimensional array.



1. Numeric array:

syntax to create this:

php code begin here


/*
  #Write a program to Numeric array in PHP
 #comment: make a array variable name $var
 #Author : amit sharma
 */


$var = array (value1,value2,value3...);

#in detail

$var = array(10,20,30,40,50,60);

now in above line we create a array name $var in php that store 6 values 10,20,30,40,50 and 60 .

php code end here


0 comments:

Post a Comment