I have an array loop 1st value in array is name and second value is the value to be inserted in the combination of 2 the array printing like this
Array
(
[0] => LE781291334
[1] => 0
[2] => JR792682920
[3] => 8,000.00
[4] => JR792733067
[5] => 1,800.00
[6] => JR792733072
[7] => 1,500.00
[8] => JR792733069
[9] => 700
[10] => JR792733068
)
Which I need every array values to be paired so I can add them into database like this
INSERT INTO table_name (valname, value) VALUES ('LE781291334', 0)
INSERT INTO table_name (valname, value) VALUES ('JR792682920', 8,000.00)
INSERT INTO table_name (valname, value) VALUES ('JR792733067', 1,800.00)
I am totally confused the value coming through api and I cannot pair them can anyone help me out for adding them in paired way?