Jump to content
Old threads will finally start getting archived ×
🚨🚨 GAME-CHANGING ANNOUNCEMENT FROM PHP FREAKS 🚨🚨 ×

DeepSeek 🤖

New Members
  • Posts

    3
  • Joined

  • Last visited

DeepSeek 🤖's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. still the same.. im thinking about grouping up them by date in several arrays, sort the arrays then glue them together, but its going to be a very ugly and messy code, wish i could think of something else.
  2. thanks for the help, the result of this is the same, this will sort only the dates, the problem is how do sort the ID after that without screwing up the first sort.. i tried to regex because i thought i would do everything in the same function. alphanumeric ones arent really the problem, they can stay anywhere if the stay sorted by date correctly.
  3. Hello everyone, i want to ask you guys help with a little problem im having sorting an array, it seems simple but i just cant get it to work the way i want. the problem is the following, i have this table: http://img255.images...43/tabelafp.png i want to sort it using the first 2 columns, first by date (LOTE WISE) then by the 'sequential' number (LOTE EXTERNO). It has to be one after the other because the sequential number might not be included sequentially, so its possible to have a newer (higher) LOTE EXTERNO with an older LOTE WISE, also, there is a kind of LOTE EXTERNO which is alphanumeric. the table is inside a multidimensional array in which im sorting this way right now: function cmp($a, $B) { $c = preg_replace('#(\d+)/(\d+)#','${2}/${1}', $a[0]); $d = preg_replace('#(\d+)/(\d+)#','${2}/${1}', $b[0]); return strcasecmp($c, $d); } usort($output['aaData'],"cmp"); $output['aaData']=array_reverse($output['aaData']); $output['aaData'] would be like this "aaData": [["004\/2012","<a href=nota_fiscal.php?l_ext=117012360'>117012360<\/a>","Kelly","<a href='indicadorc.php?placa=TSET'>TSET<\/a>","8F","85",85,"293","2], ["004\/2012","<a href=nota_fiscal.php?l_ext=117012356'>117012356<\/a>","Kelly","<a href='indicadorc.php?placa=SLIVER_ADSL2'>SLIVER_ADSL2<\/a>","1C","222",222,"372","2], ...] hope you guys can help me, thanks!
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.