skip to Main Content

PHP – Calculate Array and Assign Text

I did this while....//to get dynamic value of $data[18] One of the value is $data[18] = '256000000000;2001111162880;2001111162880;2001111162880;10000831348736;1800360124416;256000000000'; $result = []; foreach(explode("n", $data[18]) as $str){ $result[] = implode("GB/", array_map(fn($v) => floor((int)$v / 1e9), explode(";", $str))). 'GB'; } $data[18] = implode("n", $result);…

VIEW QUESTION

PHP how to join or combine multiple array

I've problem with combining 2 or more arrays in PHP. for example I've list of arrays like this : $array['item_code'] = ['ITM-001','ITM-002','ITM-003']; $array['price'] = [5000,6000,7000]; $array['qty'] = [3,4,5]; ` how to combine the arrays to be output JSON like this…

VIEW QUESTION
Back To Top
Search