arrays

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
User avatar
gurjit
Forum Contributor
Posts: 314
Joined: Thu May 15, 2003 11:53 am
Location: UK

arrays

Post by gurjit »

Hi All,

how can reset an arrays key to start from zero:

e.g.

at the beginning i had


[0] = ''
[1] = 'a'
[2] = 'b'
[3] = ''

so i did the following

Code: Select all

<?php
$start_mm = array_diff($start_mm, array(''));
?>
which took out all the blanks and now i want the array to reset the keys to say
[0] = 'a'
[1] = 'b'
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Post by CoderGoblin »

Post Reply