PHP array grouping/conditionals is it possible? -
I have a problem I have dug myself, I have a list of items that have one area In which type of boxes they fit
For example:
items | Boxtepe Quantity ------------------------------- Item 1 | A-10, C-20 3 items 2 | C-10, D-20 2 The box type is the letter box type in the column, this type of number is low, how many items can fit in it.
What I'm trying to do is to use the least amount of boxes I basically just divide the quantity by letter number, if it was below 1 year, Used to
But on the above cases, where I use Box A for Item 1, on item 2, I have to use C. It would be better to use Box C for both items because both items will fit in.
Of course this is a simple version of this problem, if necessary, I can expand with a more defined example. I was just thinking, can I sort everything with arrays?
Thanks for any point in the right direction
Edit - from this array, there is an easy way to connect to this array
array To determine the condition of letters for [[AC] = & gt; array ([a] => 0.75 [c] => 0.15) test [cd] => array ([c] = & Gt; 0.2 [D] = & gt; 0.1))
1D Like / Linear I do not know what to do with a particular language (PHP) or feature (array). For those people, please come up with another concrete example (example: How do I sort this array in PHP? array (blah = & gt; blah) ). For the past, do not specify any language, focus on algorithms.
Comments
Post a Comment