I want to sort a directive array into two div based on value.
Here's what I have now:
Function Shodievis ($ array) {/ * * Sort by group N / * luxury = false; $ No_luxury = false; $ Return = ''; While (list ($ key, $ value) = each ($ array) {if ($ value ["MinimumRate"] <500) {if ($ no_luxury === incorrect) {$ return. = '& Lt; Div id = "no_luxury" & gt; '; } $ Refund = $ Value ['description'] ":". $ Value ["minimum right"] "
"; If ($ no_luxury === false) {$ return = '& Lt; / Div & gt; '; $ No_luxury = true; }} If ($ value ["minimum right"]> 500) {if ($ luxury === incorrect) {$ return. = '& Lt; Div id = "luxury" & gt; '; } $ Refund = $ Value ['description'] ":". $ Value ["minimum right"] "
"; If ($ luxury === false) {$ return '' & Lt; / Div & gt; '; $ Luxury = true; }}} Return $ return; } My code does not work properly.
Div is being created and closed only on the first item. I think that you mean opening it in the beginning and ending it, try it: Function Shodievis ($ array) {/ * * Sort by grouping * / $ luxury = Array (); $ Not_luxury = array (); Forex currency ($ value as $ value) {if ($ value ["minimum right"]> 500) {$ luxury [] = $ value; } And {$ not_luxury [] = $ value; }} $ Return = '& lt; Div id = "no_luxury" & gt; '; Foreign currency ($ value $ luxury) {$ return = $ Value ['description']. ":". $ Value ["minimum right"] "
"; } $ Refund = '& Lt; / Div & gt; '; $ Refund = '& Lt; Div id = "luxury" & gt; '; Foreign currency ($ value $ luxury) {$ return = $ Value ['description']. ":". $ Value ["minimum right"] "
"; } $ Refund = '& Lt; / Div & gt; '; Return refund; }
Comments
Post a Comment