PHP 4.0 Bug #7267 Updated: Add an array function...
| From: | raulgd at ver dot megared dot net dot mx | Date: | Tue, 17 Oct 2000 04:24:49 +0000 |
| Subject: | PHP 4.0 Bug #7267 Updated: Add an array function... | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-35219@lists.php.net to get a copy of this message | ||
ID: 7267
User Update by: raulgd@ver.megared.net.mx
Status: Open
Bug Type: Feature/Change Request
Description: Add an array function...
Hi...
A suggestion...
You should add a function that re-indexes an array, for example...
If I have:
$array = array("one","two","three",1,4,3);
and then I delete one three and 4 then i'll have this left in the array:
$array[1] = two
$array[3] = 1
$array[5] = 3
so if you do a reindexing funct let's say array_reindex() used like this:
array_reindex($array);
then the array will be converted to this:
$array[0] = two
$array[1] = 1
$array[2] = 3
so it reindexes the whole thing because if I use any kind of sort function then it will lose the
arrays order and make it 1,3,two instead of two,1,3 or if you know any way that I can reindex an
array, please let me know or give me some sample code please
thanks a lot
Previous Comments:
---------------------------------------------------------------------------
[2000-10-17 00:20:50] raulgd@ver.megared.net.mx
Hi...
A suggestion...
You should add a function that re-indexes an array, for example...
If I have:
$array = array("one","two","three",3,4,1);
and then I delete one three and 4 then i'll have this left in the array:
$array[1] = two
$array[3] = 3
$array[5] = 1
so if you do a reindexing funct let's say array_reindex() used like this:
array_reindex($array);
then the array will be converted to this:
$array[0] = two
$array[1] = 3
$array[2] = 1
so it reindexes the whole thing because if I use any kind of sort function then it will lose the
arrays order and make it 1,3,two instead of two,3,1, or if you know any way that I can reindex an
array, please let me know or give me some sample code please
thanks a lot
---------------------------------------------------------------------------
Full Bug description available at: http://bugs.php.net/?id=7267