ohdang888 Posted April 14, 2008 Share Posted April 14, 2008 ok so my arry's are set up like this: test[1] = blah test[2] = blah test[3] = test test[4] = confused etc. and sometimes there are duplciates stored, so i used array_unique()... so that leaves so number 2 empty... is there anyway to move all the stored variable the lowest.. to make it like this: test[1] = blah test[2] = test test[3] = confused but it won't always be number 2, it changes... Link to comment https://forums.phpfreaks.com/topic/101102-move-array-names/ Share on other sites More sharing options...
rhodesa Posted April 14, 2008 Share Posted April 14, 2008 well...indexes should start at 0. if that is ok, you can use: $array = array_values(array_unique($array)); Link to comment https://forums.phpfreaks.com/topic/101102-move-array-names/#findComment-517070 Share on other sites More sharing options...
ohdang888 Posted April 14, 2008 Author Share Posted April 14, 2008 ya thanks! Link to comment https://forums.phpfreaks.com/topic/101102-move-array-names/#findComment-517076 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.