0

Hey,

I want sort an associative array of string.

such as
array(
[hotel]=>array(
[name]='Royal Cabin'
),

[hotel]=>array(
[name]='macdonald court'
))

etc...

what want is to sort the above array to a given string such as 'ro' or 'mac'
wher the array is sorted and show the closet match in the array first, and listing others after that

Please help me on this. Thanks in adnace.

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by nikesh.yadav
0

Hey,

I want sort an associative array of string.

such as
array(
[hotel]=>array(
[name]='Royal Cabin'
),

[hotel]=>array(
[name]='macdonald court'
))

etc...

what want is to sort the above array to a given string such as 'ro' or 'mac'
wher the array is sorted and show the closet match in the array first, and listing others after that

Please help me on this. Thanks in adnace.

always remember php.net for function other than daniweb and must remember almost all languages have ksort,sort like function to sort the array

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.