cheechm Posted September 20, 2008 Share Posted September 20, 2008 Hi, How would I sort these two arrays against each other? Array ( [domain] => localhost [postcode] => SW10 [name] => Point [company_name] => Point [shipping_username] => Nick [api_key] => ******** [address] => London [subtitle] => Cool Test [phone] => 0777777 [limit] => 10 [delivery] => 1.50 [email_confirm] => 1 [online] => 1 [seed] => 0dAfghRqSTgx [install_path] => /server/lhs/ ) Array ( [name] => 1 [online] => 12 [postcode] => 8 [phone] => 6 [address] => 7 [delivery] => 11 [subtitle] => 2 [email_confirm] => 9 [domain] => 3 [install_path] => 4 [seed] => 0 [limit] => 10 [api_key] => 14 [shipping_username] => 13 [company_name] => 5 ) You'll see in the second array for instance that [name] => 1 and [subtitle] => 2.. How in the first array would I order it so that is went: [name] => Point [subtitle] => Cool Test ...etc? I tried array_multisort() but I don't think it is the right one? If it is I couldn't get it to work. Thanks Quote Link to comment Share on other sites More sharing options...
Mchl Posted September 20, 2008 Share Posted September 20, 2008 I think uksort() Quote Link to comment Share on other sites More sharing options...
cheechm Posted September 21, 2008 Author Share Posted September 21, 2008 If I had an array like this: Array ( [subtitle] => Array ( [value] => Cool Test [name] => Subtitle [order] => 2 [section] => 1 [type] => 0 ) [domain] => Array ( [value] => localhost [name] => Domain Name [order] => 3 [section] => 0 [type] => 0 ) ) How would I sort the array by order? Quote Link to comment 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.