Re-indexing array?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
PhpDog
Forum Commoner
Posts: 58
Joined: Mon Jan 14, 2008 10:23 am

Re-indexing array?

Post by PhpDog »

I have an array:

$colour[0] = "Red";
$colour[1] = "Green";
$colour[2] = "Purple";
$colour[3] = "Blue";

How can I remove the first item in the array and re-index for that I get:

$colour[0] = "Green";
$colour[1] = "Purple";
$colour[2] = "Blue";
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: Re-indexing array?

Post by John Cartwright »

Post Reply