Numeric array’s in php
By admin | November 30, 2007
Sometimes you need to create many similar variables. So you need arrays
There are three different kind of arrays:
- Numeric array
- Associative array
- Multidimensional array
In this post we will only discuss Numeric array:
Syntax:
$yourname = array(“Kushagra”,”Sanjay”,”Salman”);
or
$yourname[0] = “Kushagra”;
$yourname[1] = “Sanjay”;
$yourname[2] = “Salman”;
Example 1
<?php
$yourname[0] = “Kushagra”;
$yourname[1] = “Sanjay”;
$yourname[2] = “Salman”;
echo $yourname[0].” Was first named “.$yourname[1].” And then “.$yourname[2];
?>
Thanks
krates
Topics: PHP | Comments Off on Numeric array’s in php
Related Links: