|
||||||
| PHP Forum Use this forum to discuss all aspects of PHP Development. PHP is a server-side, cross-platform, HTML embedded scripting language that lets you create dynamic web pages. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||||
|
Yes. Now, what are your criteria for the array being "sorted"?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||
|
Well I have an array that looks like this:
array[0] = "data1|data2|data3|data4"; array[1] = "data1|data2|data3|data4"; I need the array sorted by data3. The only way I can think of doing it is by cycling through the array - exploding it and then adding the data to another array. Is that right? |
|
|||||
|
It depends a little bit on whether you need to sort data1, data2, data4 in parallel with data3. If you need to sort data3 and not touch the others, I'd just pass data3 into your sort algorithm and be done.
Basicly, you need to find a "key" that you can sort linearly, and work everything off that as necessary.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
|
|||||
|
The problem is that I don't know PHP. And I wasn't clear what exactly needs to get sorted.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum Programming is a branch of mathematics. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Python arrays... | Sir_Rimo | Python | 3 | 06-20-2007 09:54 AM |
| Finding non-standard sorting order via graph theory | elle | General Programming | 1 | 05-17-2007 10:36 PM |
| Arrays | clookid | PHP Tutorials | 1 | 01-11-2007 09:30 PM |
| Arrays | Sionofdarkness | C and C++ | 5 | 07-26-2006 06:35 PM |
| Arrays in NET 2.0 or CLI Managed C++ | Void | Managed C++ | 1 | 07-18-2006 08:57 PM |
| WingedPanther | ........ | 2753.6 |
| Xav | ........ | 2704 |
| Brandon W | ........ | 1702.32 |
| John | ........ | 1207.73 |
| marwex89 | ........ | 1175.24 |
| morefood2001 | ........ | 966.05 |
| dcs | ........ | 655.75 |
| Steve.L | ........ | 475.59 |
| orjan | ........ | 418.58 |
| Aereshaa | ........ | 383.54 |
Goal: 100,000 Posts
Complete: 97%