I have a multidimensional array which is a set of exploded numbers .ie
3-4-7
2-5-1
1-2-3
They have been exploded using "-" delimiter to input into a database using a form that I copy and paste the numbers from a spreadsheet. I can load them individually or as a set. just fine. However I need put them into the database combined with another array of letters ie:
Column 1 Column2
A 347
B 251
C 123
The letters array are the name of tables in the database and the numbers are being inserted with each number a different field. Again I can explode and load them fine, but I want to be able to take the letter array, and copy the numbers into the form and have the numbers load into the database based on the names in the letter array. Any ideas would be appreciated.
Is there a way to combine each element of a multidimensional
Moderator: General Moderators
Re: Is there a way to combine each element of a multidimensi
So you've got $array[0][0] = 3? If so, I'd lose the explode altogether and simply use str_replace to remove the dashes.phillyrob wrote:I have a multidimensional array which is a set of exploded numbers .ie
3-4-7
2-5-1
1-2-3
They have been exploded using "-" delimiter
Re: Is there a way to combine each element of a multidimensi
Thanks Celauran ,
I am not following. Are you saying using str_replace will make it easier to associate each set of numbers that I copy into a form with an array?
the array will have the table names from by db and I will paste around 20 rows of numbers into a form. I just want the each row to be associated with each element of the array when i upload meaning :
Row 1 or (3-2-5) will break up and upload into table A with field names Num1, Num2,Num3
Row 2 or (6-2-7) will break up and upload into table B with field names Num1, Num2,Num3
Row 3 or (4-9-1) will break up and upload into table C with field names Num1, Num2,Num3 and so on?
I still am not sure how to associate each row with each element of the array.
I am not following. Are you saying using str_replace will make it easier to associate each set of numbers that I copy into a form with an array?
the array will have the table names from by db and I will paste around 20 rows of numbers into a form. I just want the each row to be associated with each element of the array when i upload meaning :
Row 1 or (3-2-5) will break up and upload into table A with field names Num1, Num2,Num3
Row 2 or (6-2-7) will break up and upload into table B with field names Num1, Num2,Num3
Row 3 or (4-9-1) will break up and upload into table C with field names Num1, Num2,Num3 and so on?
I still am not sure how to associate each row with each element of the array.