> -----Original Message-----
> From: I. Gray [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 21, 2005 2:34 PM
> To: [email protected]
> Subject: [PHP] resetting arrays
>
> Hi.
>
> I am sure this is easy, but I can't get this work. Is there not a php
> function that can do this?
Yes, use sort()
> I have an array- for example...
> [1] => Yellow
> [2] => Green
> [3] => Purple
> [4] => Blue
> [5] => Red
> [6] => Orange
> [7] => Cyan
This does however set yellow to 0, not 1 - run through the array with
foreach:
foreach($array AS $key => $val) {
$count++;
$new_array[$count] = $val";
}
--
Med venlig hilsen / best regards
ComX Networks A/S
Kim Madsen
Systemudvikler/Systemdeveloper
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php