Jump to content

galili

New Members
  • Posts

    5
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

galili's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Can you kindly share the code i see the logic
  2. Im using this code but unfortunately its generating repetitions function combinations($arrays, $i = 0) { if (!isset($arrays[$i])) { return array(); } if ($i == count($arrays) - 1) { return $arrays[$i]; } // get combinations from subsequent arrays $tmp = combinations($arrays, $i + 1); $result = array(); // concat each array from tmp with each element from $arrays[$i] foreach ($arrays[$i] as $v) { foreach ($tmp as $t) { $result[] = is_array($t) ? array_merge(array($v), $t) : array($v, $t); } } return $result; } print_r( combinations( array( array('A1','A2','A3', 'A4', 'A5'), array('B1','B2','B3', 'B4','B5'), array('C1','C2','C3','C4','C5') ) ) );
  3. COLUMNS Rows A B C 1 11 22 33 2 44 55 66 3 66 77 88 4 99 100 110 5 111 122 133 I have a matrix of 3 columns (A,B,C) by 5 rows (1-5). I need loops to acquire all the possible combinations possible The combination elements must cascade from the first row to the lower rows with ONLY one element from each row Rules a) Every set of combination has a max of 5 elements a) All the combinations begins at the first row (A1 or B1 or C1) AND combines with lower elements in a belt like manner from the Top to the bottom row c) In a set you cannot pick more than one element from the same row Examples right A1,A2,A3,A4,A5 B1,A2,A3,A4,A5 C1,A2,A3,A4,A5 C1,A2,A3,A4,A5 B1,B2,A3,A4,A5 WRONG C1,A2,B2,A4,A5 (A2 AND B2 have the same row number) C1,A2,B2,A4,A5 (A2 & B2 have the same row number) A3,B2,A3,B1,A5 (The first element in the set should start from the first row which is A1/B1/C1) C5,A1,A2,A3,A4 ( the first element IN a set must be A1/B1/C1)
  4. I intend to design a website for a medical clinic and need parameters tested on various disease testing results eg malaria, typhoid etc I want a knowledge base where i can get all the parameters of various diseases and their ranges. Regards
×
×
  • 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.