jagoan-neon Posted April 14, 2009 Share Posted April 14, 2009 Hi all, Need help to order an array The result when I print the array is like this : Array ( [ 0 ] => Array ( [ 2 ] => 0 [ 3 ] => 0 ) ) Array ( [ 0 ] => Array ( [ 2 ] => +62817566325 [ 3 ] => +628155212557 ) ) How to make the array in order like this Array ( [ 0 ] => Array ( [ 0 ] => 0 [ 1 ] => 0 ) ) Array ( [ 0 ] => Array ( [ 0 ] => +62817566325 [ 1 ] => +628155212557 ) ) What is the function to make array in order ? Thank you and sorry for my English Quote Link to comment https://forums.phpfreaks.com/topic/154047-solved-reset-unordered-array-to-ordered-array/ Share on other sites More sharing options...
jagoan-neon Posted April 14, 2009 Author Share Posted April 14, 2009 Solved I use array_merge Quote Link to comment https://forums.phpfreaks.com/topic/154047-solved-reset-unordered-array-to-ordered-array/#findComment-809779 Share on other sites More sharing options...
.josh Posted April 14, 2009 Share Posted April 14, 2009 array_merge has a side effect of doing what you wanted. The official way to do it though is array_values Quote Link to comment https://forums.phpfreaks.com/topic/154047-solved-reset-unordered-array-to-ordered-array/#findComment-809786 Share on other sites More sharing options...
jagoan-neon Posted April 14, 2009 Author Share Posted April 14, 2009 oh thanks! Quote Link to comment https://forums.phpfreaks.com/topic/154047-solved-reset-unordered-array-to-ordered-array/#findComment-809895 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.