goma smile Posted November 26, 2013 Report Share Posted November 26, 2013 Palīziet lūdzu iedomājieties 2 tabulas vienā ir lauks ar implodētiem skaitļiem un otrā ir skaitļi ar implodetiem skaitļiem, piemēram: kkas 1,2,3,4,5,6 un citā tabulā tādā pašā stilā 1,2,3,7,8,9,11 un kā var izvilkt sarakstu ar tikai unikāliem skaitļiem pēc salīdzināšanas starp abām tabulām 1,2,3,4,5,6,7,8,9,11 - kaut kā tā Quote Link to comment Share on other sites More sharing options...
Kasspars Posted November 27, 2013 Report Share Posted November 27, 2013 array_unique( array_merge( array(1,2,3,4,5,6), array(1,2,3,7,8,9,11) ) ) Quote Link to comment Share on other sites More sharing options...
goma smile Posted November 27, 2013 Author Report Share Posted November 27, 2013 Paldies, un varētu lūdzu to pašu izpildi Jquery ? Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted November 27, 2013 Report Share Posted November 27, 2013 ar http://vanilla-js.com - piemēram http://jsfiddle.net/p5M2L/ Quote Link to comment Share on other sites More sharing options...
goma smile Posted December 18, 2013 Author Report Share Posted December 18, 2013 array_unique( array_merge( array(1,2,3,4,5,6), array(1,2,3,7,8,9,11) ) ) Iedomājieties ka man ģenerējās kkas šāds kā var apvienot lai nosaka unikālās vērtības [0] => Array ( [0] => 110 [1] => 122 [2] => 123 ) [1] => Array ( [0] => 112 ) [2] => Array ( [0] => 122 ) [3] => 110 [4] => 120 [5] => 130 Quote Link to comment Share on other sites More sharing options...
marrtins Posted December 18, 2013 Report Share Posted December 18, 2013 (edited) kā var apvienot lai nosaka unikālās vērtībasKota? o_O Tev vajag atfiltrēt unikālās pa visām dimensijām; vai saskaitīt, cik ir unikālo; vai "saplacināt" visas dimensijas vienā; vai ...? Edited December 18, 2013 by marrtins Quote Link to comment Share on other sites More sharing options...
daGrevis Posted December 18, 2013 Report Share Posted December 18, 2013 (edited) Hmm, saliec abus listus kopā un uztaisi par setu. Datu tipi un to īpašības, jēj! Pseido-kods: ~~~ >>> print(set([1, 2, 2, 3] + [3, 1])) {1, 2, 3} ~~~ Edited December 18, 2013 by daGrevis Quote Link to comment Share on other sites More sharing options...
goma smile Posted December 19, 2013 Author Report Share Posted December 19, 2013 (edited) Interesē unikālās vērtības Īsāk sakot unikālās vērtības starp multidimensiju un nemultidimensiju masīvu No mana iepriekšējā masīva 110, 122, 123, 112, 120, 130 Edited December 19, 2013 by goma smile Quote Link to comment Share on other sites More sharing options...
v3rb0 Posted December 19, 2013 Report Share Posted December 19, 2013 $z = array(array(110, 122, 123),array(112),array(122),110,120,130); $u = array_unique(iterator_to_array(new RecursiveIteratorIterator(new RecursiveArrayIterator($z)), false)); print_r($u); 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.