Home Yellow Pages Movies Classifieds Jokes Jobs Free Hosting Videos

Numeric Arrays

A numeric array stores each element with a numeric ID key.

There are different ways to create a numeric array.

Example 1

In this example the ID key is automatically assigned:

$names = array("Peter","John","Joe");

Example 2

In this example we assign the ID key manually:

$names[0] = "Peter";

$names[1] = "John";

$names[2] = "Joe";

The ID keys can be used in a script:

$names[0] = "Peter";
$names[1] = "John";
$names[2] = "Joe";
echo $names[1] . " and " . $names[2] . " are ". $names[0] . "'s neighbours";

The code above will output:

John and Joe are Peter's neighbours.

Back to Home
BizHat.com   Bookmark   Astrology   Chat Room   Classifieds   Computer   Downloads   Directory   Dating   Domain Tools   Education   eCards   Finance   Forums   Freelance Work   Free Hosting   Free Mail   Gallery   Games   Guest Book   Greeting Cards   Ham Radio   Health   Home Business   Hosting Tutorials   Hosting Directory   India   Jobs   Jokes   Kerala   Matrimonial   Music   Movies   News   News Letter   Recipes   Real Estate   Search   SMS   Tourist Guide   Top 100 Sites   Vote Us   Yellow Pages   Arthunkal Church   Site Map