Re: resetting arrays

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

Tuesday, June 21, 2005, 1:33:55 PM, you wrote:

IG> I have an array- for example...
IG> What happens, say if I delete [3] => Purple?  I get...
IG> But what if I want to reset the numbers? Like...

<?php
        $array = array(0 => 'a', 1 => 'b', 2 => 'c', 3 => 'd', 4 => 'e');
        print_r($array);
        
        unset($array[3]);
        print_r($array);

        sort($array);
        print_r($array);
?>

Best regards,

Richard Davey
-- 
 http://www.launchcode.co.uk - PHP Development Services
 "I do not fear computers. I fear the lack of them." - Isaac Asimov

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux