skip to Main Content

RegExp in PHP – Get multiarray from string

I have a strings with pattern, something like this: (X,1,1,3),(X,1,1,3),(X,@2,@2,@2,@2,@2,(Y,1)) And I need to extract from this One big array, reverse order, and generate new string: (X,(Y,1),@2,@2,@2,@2,@2),(X,3,1,1),(X,3,1,1) And expected array: Array ( [0] => Array( [parent] => (X,1,1,3) [childs] =>…

VIEW QUESTION

Jquery – Nan to sum array

I need to sum value of same id. This is my code var myarray = [ {"a25": "5000"},{"s36": "125"},{"d44": "15"},{"a25": "3500"},{"s36": "25"},{"d44": "164"},{"a25": "4500"},{"s36": "1251"},{"d44": "75"},{"a25": "251"},{"s36": "120"},{"d44": "94"},{"a25": "12515"} ]; var total_byID = []; $.each(myarray, function(index, item){ $.each(item, function(id,value){…

VIEW QUESTION
Back To Top
Search