Get help on web editors (Frontpage, Dreamweaver) and web languages (HTML, ASP, PHP).
DarkRanger
Registered User
Posts: 8346 Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:
Post
by DarkRanger » 18 Jul 2011, 16:17
I have the following:
Code: Select all
$resultArray[$c]['id'];
$resultArray[$c]['filename'];
$resultArray[$c]['keywords'];
$resultArray[$c]['matchPercentage'];
How do I sort this array by $resultArray[$c]['matchPercentage'] from high to low?
D3PART3D
Starbound's Dear
Posts: 16295 Joined: 01 Dec 2004, 02:00
Contact:
Post
by D3PART3D » 18 Jul 2011, 16:27
Wow, awesome thread title.
Ceterum autem censeo Samsung Mobile esse delendam.
When something is important enough, you do it even if the odds are not in your favor.
- Elon Musk
DarkRanger
Registered User
Posts: 8346 Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:
Post
by DarkRanger » 18 Jul 2011, 16:31
What should I have named it?
D3PART3D
Starbound's Dear
Posts: 16295 Joined: 01 Dec 2004, 02:00
Contact:
Post
by D3PART3D » 18 Jul 2011, 16:38
No, I mean Star Trek awesome.
Ceterum autem censeo Samsung Mobile esse delendam.
When something is important enough, you do it even if the odds are not in your favor.
- Elon Musk
Bladerunner
Registered User
Posts: 14338 Joined: 04 Sep 2004, 02:00
Processor: i386DX Sooper
Motherboard: A blue one
Graphics card: A red one
Memory: Hard drive
Location: On a Möbius strip
Contact:
Post
by Bladerunner » 20 Jul 2011, 13:06
DarkRanger wrote: I have the following:
Code: Select all
$resultArray[$c]['id'];
$resultArray[$c]['filename'];
$resultArray[$c]['keywords'];
$resultArray[$c]['matchPercentage'];
How do I sort this array by $resultArray[$c]['matchPercentage'] from high to low?
Are you looking for something along the lines of Array.Sort (
) or are you actually interested in implementing an algorithm like Bubble-, Selection-, Insertion-, or Quicksort?
If I weren't insane: I couldn't be so brilliant! - The Joker
DarkRanger
Registered User
Posts: 8346 Joined: 10 May 2006, 02:00
Processor: Intel i5-3750
Motherboard: Gigabyte
Graphics card: nVidia GTX 550Ti
Memory: 8GB Jetram
Contact:
Post
by DarkRanger » 21 Jul 2011, 12:09
Just want something basic. So along the lines of array.sort will be fine!