Solution figured out...
Well, I was able to figure out the solution by playing around with the indexes and coming to the conclusion that the second index was not necessary. As soon as I dropped that index PHP moved everything as desired. Solution looked like this:
arr1[0] = arr2[j];
Suggesting that PHP add additional items to a multi-dimensioned array the same way it does in single dimensioned arrays...
User Profile
Collapse
-
Not what I need...
I need to extract the field to the second part of the multi-field array (arr1[0][$j]).
Further info:
I tried putting the information into a variable and then loading the array from the variable and the destination array (arr1) still is truncating all but the first character.
$holdingCell = $arr2[$j];
$arr1[0][$j] = $holdingCell;
echo $holdingCell;...Leave a comment:
-
PHP Single Array to Multi Array Problem
I have exploded a file line into a single dimensioned array. I want to take the contents of the single deminsioned array and separate it out into a multi-dimensioned array.
In the for loop I have code like this:
$arr1[0][$j] = $arr2[$j];
where the j index is changing. The result is only the first character of the arr2 is being deposited into arr1 for each element of the array. arr2 is still intact...
No activity results to display
Show More
Leave a comment: